diff options
author | Benjamin Chausse <benjamin.chausse@goto.com> | 2025-03-26 10:52:14 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin.chausse@goto.com> | 2025-03-26 10:52:14 -0400 |
commit | 04213e975c46b0d6bfecc8695801b85c3f3dd0ab (patch) | |
tree | 73d39c5f614c83baad5eb6ad8669a27750770e2a /internal/logging/discard.go | |
parent | cd9338e0d6cf582f9ea8028661ac3729e408f3bf (diff) |
charmbracelet/glamour for help + man page generate
Diffstat (limited to 'internal/logging/discard.go')
-rw-r--r-- | internal/logging/discard.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/logging/discard.go b/internal/logging/discard.go new file mode 100644 index 0000000..e827287 --- /dev/null +++ b/internal/logging/discard.go @@ -0,0 +1,25 @@ +package logging + +import ( + "context" + "log/slog" +) + +// DiscardHandler discards all log output. DiscardHandler.Enabled returns false for all Levels. +type DiscardHandler struct{} + +func (d DiscardHandler) Enabled(ctx context.Context, level slog.Level) bool { + return false +} + +func (d DiscardHandler) Handle(ctx context.Context, record slog.Record) error { + return nil +} + +func (d DiscardHandler) WithAttrs(attrs []slog.Attr) slog.Handler { + return d +} + +func (d DiscardHandler) WithGroup(name string) slog.Handler { + return d +} |