Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler creates a slog.Handler that writes tinted logs to Writer w, using the default options. If opts is nil, the default options are used.
Types ¶
type Options ¶
type Options struct {
// Minimum level to log (Default: slog.LevelInfo)
Level slog.Leveler
// ReplaceAttr is called to rewrite each non-group attribute before it is logged.
// See https://pkg.go.dev/log/slog#HandlerOptions for details.
ReplaceAttr func(groups []string, attr slog.Attr) slog.Attr
}
Options for a slog.Handler that writes colored logs. A zero Options consists entirely of default values.
type StaticLevelLogger ¶
type StaticLevelLogger struct {
// contains filtered or unexported fields
}
func DecorateAtLevel ¶
func DecorateAtLevel(l logging.Logger, level slog.Level) *StaticLevelLogger
func (*StaticLevelLogger) Print ¶
func (d *StaticLevelLogger) Print(v ...any)
Click to show internal directories.
Click to hide internal directories.