Documentation
¶
Overview ¶
Package logging configures gskill's structured logger. Logs always go to stderr (never stdout, which is reserved for primary command output), with the level and format taken from configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New builds an slog.Logger from opts, defaulting the sink to stderr and the encoding to text.
func ParseLevel ¶
ParseLevel maps a case-insensitive level name ("debug", "info", "warn", "error") to an slog.Level, falling back to slog.LevelInfo for empty or unknown values.
Types ¶
type Options ¶
type Options struct {
// Level is the minimum level emitted. The zero value is slog.LevelInfo.
Level slog.Level
// Format selects text or JSON encoding. The zero value is FormatText.
Format Format
// Writer is the log sink. The zero value is os.Stderr.
Writer io.Writer
}
Options configures a logger built by New.
Click to show internal directories.
Click to hide internal directories.