Documentation ¶
Index ¶
- func Addr(key string, addr netip.Addr) slog.Attr
- func AddrPort(key string, addrPort netip.AddrPort) slog.Attr
- func AddrPortp(key string, addrPortp *netip.AddrPort) slog.Attr
- func Addrp(key string, addrp *netip.Addr) slog.Attr
- func Err(err error) slog.Attr
- func Int[V ~int | ~int8 | ~int16 | ~int32 | ~int64](key string, value V) slog.Attr
- func Uint[V ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr](key string, value V) slog.Attr
- type Logger
- func (l *Logger) Debug(msg string, attrs ...slog.Attr)
- func (l *Logger) Enabled(level slog.Level) bool
- func (l *Logger) Error(msg string, attrs ...slog.Attr)
- func (l *Logger) Info(msg string, attrs ...slog.Attr)
- func (l *Logger) Log(level slog.Level, msg string, attrs ...slog.Attr)
- func (l *Logger) Warn(msg string, attrs ...slog.Attr)
- func (l *Logger) WithAttrs(attrs ...slog.Attr) *Logger
- func (l *Logger) WithGroup(group string) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Addr ¶
Addr returns a slog.Attr for a netip.Addr.
func AddrPort ¶
AddrPort returns a slog.Attr for a netip.AddrPort.
func AddrPortp ¶
AddrPortp returns a slog.Attr for a *netip.AddrPort.
Use AddrPort if the address is not already on the heap, or the call is guarded by Logger.Enabled.
func Addrp ¶
Addrp returns a slog.Attr for a *netip.Addr.
Use Addr if the address is not already on the heap, or the call is guarded by Logger.Enabled.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is an opinionated logging implementation that writes structured log messages, tinted with color by default, to os.DevNull.
func (*Logger) Debug ¶
Debug logs the given message at slog.LevelDebug.
func (*Logger) Error ¶
Error logs the given message at slog.LevelError.
func (*Logger) Info ¶
Info logs the given message at slog.LevelInfo.
func (*Logger) Warn ¶
Warn logs the given message at slog.LevelWarn.