Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LevelFlagOptions represents allowed logging levels. LevelFlagOptions = []string{"debug", "info", "warn", "error"} // FormatFlagOptions represents allowed formats. FormatFlagOptions = []string{"logfmt", "json"} )
Functions ¶
func New ¶
New returns a new slog.Logger. Each logged line will be annotated with a timestamp. The output always goes to stderr.
func NewNopLogger ¶ added in v0.60.0
NewNopLogger is a convenience function to return an slog.Logger that writes to io.Discard.
Types ¶
type Format ¶ added in v0.63.0
type Format struct {
// contains filtered or unexported fields
}
Format controls a logging output format. Not concurrency-safe.
type Level ¶ added in v0.63.0
type Level struct {
// contains filtered or unexported fields
}
Level controls a logging level, with an info default. It wraps slog.LevelVar with string-based level control. Level is safe to be used concurrently.
func (*Level) Level ¶ added in v0.65.0
Level returns the value of the logging level as an slog.Level.
func (*Level) UnmarshalYAML ¶ added in v0.63.0
Click to show internal directories.
Click to hide internal directories.