Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultTimeFormat = "2006-01-02T03:04.05 MST"
We use RFC datestring by default
View Source
const VERSION = "0.1.3"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
NewHandler returns a log/slog.Handler using the receiver's options. Default options are used if opts is nil.
func (*Handler) Postprocess ¶
type Options ¶
type Options struct { Level slog.Leveler ReplaceAttr func(groups []string, a slog.Attr) slog.Attr TimeFormat string AddSource bool NoColor bool }
Options are options for the Yadu log/slog.Handler.
Level sets the minimum log level.
ReplaceAttr is a function you can define to customize how supplied attrs are being handled. It is empty by default, so nothing will be altered.
Loglevel and message cannot be altered using ReplaceAttr. Timestamp can only be removed, see example. Keep in mind that everything will be passed to yaml.Marshal() in the end.
Click to show internal directories.
Click to hide internal directories.