Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.115.0
type Config struct { // Level is the minimum log level that will be emitted. Defaults to slog.LevelInfo if not set. Level slog.Leveler // LevelNames is an optional map of slog.Level to string that will be used to format the log level. If not set, the // default slog level names will be used. LevelNames map[slog.Level]string // Sink is the io.Writer that will receive the formatted log output. Defaults to os.Stderr if not set. Sink io.Writer // BufferDepth greater than 0 will enable asynchronous delivery of log messages to the sink. When enabled, if there // is no room remaining in the buffer, the message will be discarded rather than waiting for room to become // available. Defaults to 0 for synchronous delivery. BufferDepth int }
Config is used to configure a Handler.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides a formatted text output that may include a stack trace on separate lines. The stack trace is formatted such that most IDEs will auto-generate links for it within their consoles. Note that this slog.Handler is not optimized for performance, as I expect those that need to run this is environments where that matters will use one of the implementations provided by slog itself.
Click to show internal directories.
Click to hide internal directories.