Documentation ¶
Index ¶
- func Duration(key string, value time.Duration) slog.Attr
- func Error(key string, value error) slog.Attr
- func Int(key string, value int) slog.Attr
- func Int32(key string, value int32) slog.Attr
- func Int64(key string, value int64) slog.Attr
- func Interface(key string, value interface{}) slog.Attr
- func String(key, value string) slog.Attr
- func Uint32(key string, value uint32) slog.Attr
- func Uint64(key string, value uint64) slog.Attr
- type DiscardHandler
- type Leveler
- type Rotator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiscardHandler ¶
type DiscardHandler struct{}
log/slog currently doesn't have a cheap and fast way to implement a discard logger, though it does appear to be coming soon (see: https://github.com/golang/go/issues/62005). This implements this function in the short term until it can be officially added.
type Rotator ¶
type Rotator struct {
// contains filtered or unexported fields
}
This is partial implementation of a slog.Handler that will handle output to a file/console while also supporting concepts like rotation. This functionality is not present in the default slog Handlers.
Note that this does not perform moves on the underlying file. It is assumed that something like logrotate will be handling that.
Click to show internal directories.
Click to hide internal directories.