Documentation
¶
Overview ¶
Package logging provides structured logging configuration using log/slog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Level is the minimum log level to output.
Level slog.Level
// JSON enables JSON output format (for production).
JSON bool
// Output is the writer to write logs to. Defaults to os.Stderr.
Output io.Writer
}
Config holds logging configuration options.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a default logging configuration suitable for development. It reads the LOG_LEVEL environment variable to set the logging level. Valid values: DEBUG, INFO, WARN, ERROR. Defaults to INFO.
func ProductionConfig ¶
func ProductionConfig() Config
ProductionConfig returns a logging configuration suitable for production.
Click to show internal directories.
Click to hide internal directories.