Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log/slog: add DiscardHandler #70296

Closed
wants to merge 4 commits into from

Conversation

earthboundkid
Copy link
Contributor

@earthboundkid earthboundkid commented Nov 12, 2024

This adds a package-level variable, slog.DiscardHandler, which is a
slog.Handler which performs no output. This serves a similar purpose
to io.Discard.

Fixes #62005

This adds a package-level variable, slog.Discard, which is a
slog.Handler which performs no output. This serves a similar purpose to
io.Discard.

Fixes golang#62005
@gopherbot
Copy link
Contributor

This PR (HEAD: 8f714b1) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/626486.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 2:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-11-12T04:06:26Z","revision":"62178854c5227d6614456061319034180eceb5e5"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 2:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-linux-amd64-boringcrypto has failed with summary (view all results):


Build or test failure, click here for results.

To reproduce, try gomote repro 8731505597253371713.

Additional links for debugging:


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 2: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 5443570) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/626486.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 3: Commit-Queue+1

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 3:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-11-12T17:35:16Z","revision":"ccceedb8e6ba186e1e5cec5579eed1017d68ddc1"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 3: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 3:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-windows-386 has failed with summary (view all results):


Build or test failure, click here for results.

To reproduce, try gomote repro 8731454709552251889.

Additional links for debugging:


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 3: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 3f05e6a) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/626486.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Carlana Johnson:

Patch Set 4:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 4: Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 4: Code-Review+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Carlana Johnson:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 5: Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Carlana Johnson:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Carlana Johnson:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Carlos Amedee:

Patch Set 5: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 5: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 5:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-11-14T17:34:47Z","revision":"3facfa330a8d1a1e7c6bc61138b9cb13e9674863"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 5: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 5:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-windows-386 has failed with summary (view all results):


Build or test failure, click here for results.

To reproduce, try gomote repro 8731273545720063377.

Additional links for debugging:


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 5: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Carlana Johnson:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 0a61117) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/626486.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 5: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 5:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-11-14T19:40:20Z","revision":"3facfa330a8d1a1e7c6bc61138b9cb13e9674863"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 5: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 6: Code-Review+2 Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 6:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-11-14T20:20:41Z","revision":"0ff322149e89d7ca1c3083fcd582c084ecc8fae6"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jonathan Amsterdam:

Patch Set 6: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 6:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-windows-386 has failed with summary (view all results):


Build or test failure, click here for results.

To reproduce, try gomote repro 8731263108755041505.

Additional links for debugging:


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 6: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 7: Auto-Submit+1 Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 7:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-11-14T22:03:49Z","revision":"9b74c1bc40641ebdc0e4d926c17d0ab48d8494c1"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/626486.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Nov 14, 2024
This adds a package-level variable, slog.DiscardHandler, which is a
slog.Handler which performs no output. This serves a similar purpose
to io.Discard.

Fixes #62005

Change-Id: Ia8babc55f860dec9b663a5c400090a7669608fd5
GitHub-Last-Rev: 0a61117
GitHub-Pull-Request: #70296
Reviewed-on: https://go-review.googlesource.com/c/go/+/626486
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
Reviewed-by: Carlos Amedee <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/626486 has been merged.

@gopherbot gopherbot closed this Nov 14, 2024
@earthboundkid earthboundkid deleted the cj/discard branch November 14, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

log/slog: add slog.DiscardHandler
2 participants