-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
listener.go/dialer.go: Don't log error messages by default.
This is more in line with standard practices. In production, these messages would probably not be desirable.
- Loading branch information
Showing
4 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package internal | ||
|
||
import ( | ||
"context" | ||
"log/slog" | ||
) | ||
|
||
// DiscardHandler implements a slog.Handler that is always disabled. Each of its | ||
// methods return immediately without any code running. | ||
type DiscardHandler struct{} | ||
|
||
func (d DiscardHandler) Enabled(context.Context, slog.Level) bool { return false } | ||
func (d DiscardHandler) Handle(context.Context, slog.Record) error { return nil } | ||
func (d DiscardHandler) WithAttrs([]slog.Attr) slog.Handler { return d } | ||
func (d DiscardHandler) WithGroup(string) slog.Handler { return d } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters