Versions in this module Expand all Collapse all v0 v0.1.0 Aug 3, 2026 Changes in this version + const LevelCrit + const LevelDebug + const LevelError + const LevelInfo + const LevelTrace + const LevelWarn + const LvlDebug + const LvlInfo + const LvlTrace + func ApplyOptions(cfg *Config, opts ...Option) + func Crit(msg string, ctx ...interface{}) + func Debug(msg string, ctx ...interface{}) + func DiscardHandler() slog.Handler + func Error(msg string, ctx ...interface{}) + func FormatLogfmtUint64(n uint64) string + func FormatSlogValue(v slog.Value, tmp []byte) (result []byte) + func FromLegacyLevel(lvl int) slog.Level + func Info(msg string, ctx ...interface{}) + func JSONHandler(wr io.Writer) slog.Handler + func JSONHandlerWithLevel(wr io.Writer, level slog.Level) slog.Handler + func LevelAlignedString(l slog.Level) string + func LevelString(l slog.Level) string + func LogfmtHandler(wr io.Writer) slog.Handler + func LogfmtHandlerWithLevel(wr io.Writer, level slog.Level) slog.Handler + func MustSetup(cfg *Config, opts ...Option) + func MustSetupFromTOML(path string, opts ...Option) + func SetDefault(l Logger) + func Setup(cfg *Config, opts ...Option) error + func SetupFromTOML(path string, opts ...Option) error + func Trace(msg string, ctx ...interface{}) + func Warn(msg string, ctx ...interface{}) + type Config struct + Compress bool + FilePath string + Format string + MaxAge int + MaxBackups int + MaxSizeMB int + Rotation bool + Verbosity int + Vmodule string + func DefaultConfig() *Config + func LoadFromBytes(data []byte) (*Config, error) + func LoadFromFile(path string) (*Config, error) + func LoadFromReader(r io.Reader) (*Config, error) + func LoadFromTOML(path string) (*Config, error) + type GlogHandler struct + func NewGlogHandler(h slog.Handler) *GlogHandler + func (h *GlogHandler) Enabled(ctx context.Context, lvl slog.Level) bool + func (h *GlogHandler) Handle(_ context.Context, r slog.Record) error + func (h *GlogHandler) Verbosity(level slog.Level) + func (h *GlogHandler) Vmodule(ruleset string) error + func (h *GlogHandler) WithAttrs(attrs []slog.Attr) slog.Handler + func (h *GlogHandler) WithGroup(name string) slog.Handler + type Logger interface + Crit func(msg string, ctx ...interface{}) + Debug func(msg string, ctx ...interface{}) + Enabled func(ctx context.Context, level slog.Level) bool + Error func(msg string, ctx ...interface{}) + Handler func() slog.Handler + Info func(msg string, ctx ...interface{}) + Log func(level slog.Level, msg string, ctx ...interface{}) + New func(ctx ...interface{}) Logger + Trace func(msg string, ctx ...interface{}) + Warn func(msg string, ctx ...interface{}) + With func(ctx ...interface{}) Logger + Write func(level slog.Level, msg string, attrs ...any) + func New(ctx ...interface{}) Logger + func NewLogger(h slog.Handler) Logger + func Root() Logger + type Option func(*Config) + func WithCompress() Option + func WithFilePath(path string) Option + func WithFormat(format string) Option + func WithJSONFormat() Option + func WithLogfmtFormat() Option + func WithMaxAge(days int) Option + func WithMaxBackups(n int) Option + func WithMaxSizeMB(size int) Option + func WithRotation() Option + func WithTerminalFormat() Option + func WithVerbosity(level int) Option + func WithVmodule(vmodule string) Option + type TerminalHandler struct + func NewTerminalHandler(wr io.Writer, useColor bool) *TerminalHandler + func NewTerminalHandlerWithLevel(wr io.Writer, lvl slog.Level, useColor bool) *TerminalHandler + func (h *TerminalHandler) Enabled(_ context.Context, level slog.Level) bool + func (h *TerminalHandler) Handle(_ context.Context, r slog.Record) error + func (h *TerminalHandler) ResetFieldPadding() + func (h *TerminalHandler) WithAttrs(attrs []slog.Attr) slog.Handler + func (h *TerminalHandler) WithGroup(name string) slog.Handler + type TerminalStringer interface + TerminalString func() string