Documentation
¶
Overview ¶
Package logger configures Compozy structured logging.
Index ¶
- func MirrorToStderrEnabled(getenv func(string) string) bool
- func New(opts ...Option) (*slog.Logger, func() error, error)
- func ParseLevel(raw string) (slog.Level, error)
- func WithMirrorToStderrEnv(sandbox []string, enabled bool) []string
- func WithRedaction(log *slog.Logger) *slog.Logger
- type FileRotationConfig
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MirrorToStderrEnabled ¶
MirrorToStderrEnabled reports whether process-local logging should still be mirrored to stderr.
func New ¶
New constructs a structured logger and returns a close function for any opened file handle.
func ParseLevel ¶
ParseLevel converts the configured string level into slog's level type.
func WithMirrorToStderrEnv ¶
WithMirrorToStderrEnv sets the detached-process env override controlling stderr mirroring.
Types ¶
type FileRotationConfig ¶
FileRotationConfig configures the daemon log sink's file rotation policy.
type Option ¶
type Option func(*options)
Option customizes logger construction.
func WithFileRotation ¶
func WithFileRotation(rotation FileRotationConfig) Option
WithFileRotation enables lumberjack-backed rotation for the structured file sink.
func WithMirrorToStderr ¶
WithMirrorToStderr mirrors logs to stderr in addition to any file target.