Files
core/logz/config.go
T

21 lines
685 B
Go
Raw Normal View History

package logz
import (
"io"
"log/slog"
)
// Config configures a Logger instance.
// The zero value is valid: INFO level, text output, os.Stdout, no static args.
type Config struct {
// Level is the minimum log level. Default: slog.LevelInfo (zero value).
Level slog.Level `env:"EINHERJAR_LOG_LEVEL" envDefault:"INFO"`
// JSON enables JSON output. Default: false (text output).
JSON bool `env:"EINHERJAR_LOG_JSON" envDefault:"false"`
// StaticArgs are key-value pairs attached to every log record.
StaticArgs []any
// Writer is the output destination. Defaults to os.Stdout when nil.
// Accepts any io.Writer: *os.File, bytes.Buffer, io.MultiWriter, etc.
Writer io.Writer
}