Versions in this module Expand all Collapse all v0 v0.1.0 Apr 25, 2026 Changes in this version + func Debug(msg string, args ...any) + func Error(msg string, args ...any) + func Info(msg string, args ...any) + func Warn(msg string, args ...any) + type ConsoleFormat int + const ConsoleJSON + const ConsolePretty + type ConsoleOption func(*consoleConfig) + func ConsoleWriter(w io.Writer) ConsoleOption + type ConsoleStream struct + func NewConsoleStream(format ConsoleFormat, level Level, opts ...ConsoleOption) *ConsoleStream + func (s *ConsoleStream) Close() error + func (s *ConsoleStream) Enabled(level Level) bool + func (s *ConsoleStream) Name() string + func (s *ConsoleStream) Write(ctx context.Context, rec Record) error + type FileFormat int + const FileJSON + const FileText + type FileStream struct + func MustFileStream(path string, cfg FileStreamConfig) *FileStream + func NewFileStream(path string, cfg FileStreamConfig) (*FileStream, error) + func (s *FileStream) Close() error + func (s *FileStream) Enabled(level Level) bool + func (s *FileStream) Name() string + func (s *FileStream) Write(ctx context.Context, rec Record) error + type FileStreamConfig struct + Compress bool + Format FileFormat + Level Level + MaxAge time.Duration + MaxBackups int + MaxSizeMB int + type Level = slog.Level + const LevelDebug + const LevelError + const LevelInfo + const LevelWarn + func LevelFromString(s string) Level + type Logger struct + func Default() *Logger + func New(opts ...Option) *Logger + func SetDefault(l *Logger) *Logger + func (l *Logger) Close() error + func (l *Logger) Debug(msg string, args ...any) + func (l *Logger) Error(msg string, args ...any) + func (l *Logger) Info(msg string, args ...any) + func (l *Logger) Warn(msg string, args ...any) + func (l *Logger) With(attrs map[string]any) *Logger + type Option func(*Logger) + func WithAttrs(attrs map[string]any) Option + func WithErrorHandler(fn func(stream string, rec Record, err error)) Option + func WithStream(s Stream) Option + type Record struct + Attrs map[string]any + Level Level + Message string + Time time.Time + func (r Record) LevelLabel() string + type Stream interface + Close func() error + Enabled func(level Level) bool + Name func() string + Write func(ctx context.Context, rec Record) error