Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LevelDebug is used for development and debugging messages. LevelDebug = Level(slog.LevelDebug) // LevelInfo is used for normal informational messages. LevelInfo = Level(slog.LevelInfo) // LevelWarn is used when something has possibly gone wrong. LevelWarn = Level(slog.LevelWarn) // LevelError is used when something has certainly gone wrong. LevelError = Level(slog.LevelError) // LevelCritical is used when when something has gone wrong and should // be immediately investigated. LevelCritical = Level(slog.LevelCritical) // LevelFatal is used when the process is about to exit due to an error. LevelFatal = Level(slog.LevelFatal) )
View Source
var Default = New(DefaultConfig)
Default is the default logger
View Source
var DefaultConfig = Config{ Writer: os.Stdout, Make: Terminal, Level: LevelDebug, Context: context.Background(), Fields: []Field{}, }
DefaultConfig represents default logger configuration
Functions ¶
Types ¶
type Config ¶
type Config struct { Writer io.Writer Level Level Context context.Context Make func(io.Writer) slog.Logger Fields []Field }
Config represents a logger configuration
Click to show internal directories.
Click to hide internal directories.