logging

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 6 Imported by: 0

Documentation

Overview

Package logging provides structured logging with file rotation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(cfg Config) (func() error, error)

Setup initializes the global slog logger with the given configuration. Returns a cleanup function that should be called on shutdown.

Types

type Config

type Config struct {
	Level      string // Log level: debug, info, warn, error
	FilePath   string // Path to log file (empty = stderr only)
	MaxSizeMB  int    // Max size in MB before rotation
	MaxBackups int    // Max number of old log files to retain
	MaxAgeDays int    // Max age in days to retain old log files
	Compress   bool   // Whether to compress rotated files
}

Config holds logging configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns sensible defaults for logging.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL