Documentation
¶
Overview ¶
! Original repository: github.com/lmittmann/tint
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Err ¶
Err returns a tinted (colorized) slog.Attr that will be written in red color by the [tint.Handler]. When used with any other slog.Handler, it behaves as
slog.Any("err", err)
Types ¶
type Options ¶
type Options struct {
// Enable source code location (Default: false)
AddSource bool
// Minimum level to log (Default: logx.LevelInfo)
Level logx.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
// Time format (Default: time.StampMilli)
TimeFormat string
// Disable color (Default: false)
NoColor bool
}
Options for a slog.Handler that writes tinted logs. A zero Options consists entirely of default values.
Options can be used as a drop-in replacement for slog.HandlerOptions.
Click to show internal directories.
Click to hide internal directories.