Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsoleHandler ¶
type ConsoleHandler struct {
// contains filtered or unexported fields
}
ConsoleHandler is a Handler that writes Records to an io.Writer as line-delimited JSON objects.
func NewConsoleHandler ¶
func NewConsoleHandler(l slog.Leveler) *ConsoleHandler
NewConsoleHandler creates a ConsoleHandler that writes to w, using the default options.
func (*ConsoleHandler) Enabled ¶
Enabled reports whether the handler handles records at the given level. The handler ignores records whose level is lower.
func (*ConsoleHandler) Handle ¶
Handle formats its argument Record as single line.
If the Record's time is zero, the time is omitted.
If the Record's level is zero, the level is omitted. Otherwise, the key is "level" and the value of [Level.String] is output.
Each call to Handle results in a single serialized call to io.Writer.Write.
Click to show internal directories.
Click to hide internal directories.