Documentation ¶
Index ¶
Constants ¶
View Source
const ( LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError LevelDebug = slog.LevelDebug )
Variables ¶
View Source
var ( NewTextHandler = slog.NewTextHandler NewJSONHandler = slog.NewJSONHandler New = slog.New SetDefault = slog.SetDefault StringAttr = slog.String BoolAttr = slog.Bool Float64Attr = slog.Float64 AnyAttr = slog.Any DurationAttr = slog.Duration IntAttr = slog.Int Int64Attr = slog.Int64 Uint64Attr = slog.Uint64 GroupValue = slog.GroupValue Group = slog.Group )
Functions ¶
Types ¶
type HandlerOptions ¶
type HandlerOptions = slog.HandlerOptions
type Logger ¶
func WithDefaultAttrs ¶
WithDefaultAttrs returns logger with default attributes.
type Option ¶
type Option func(*Options)
func WithAddSource ¶
WithAddSource logger option sets the add source option, which will add source file and line number to the log record.
func WithIsJSON ¶
WithIsJSON logger option sets the is json option, which will set JSON format for the log record.
func WithSetDefault ¶
WithSetDefault logger option sets the set default option, which will set the created logger as default logger.
Click to show internal directories.
Click to hide internal directories.