Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // LogLevel holds the logging level from --log-level flag. // Set by commands that call PreRunESetup(). LogLevel string // LogOutput holds the log output destination from --log-output flag. // Set by commands that call PreRunESetup(). LogOutput string // Logger is the configured global logger instance. // Configured in PreRunESetup() based on LogLevel and LogOutput values. Logger polylog.Logger )
Functions ¶
func NewSetupConsoleWriter ¶
NewSetupConsoleWriter returns a polylog setup function which wraps the underlying zerolog logger in a ConsoleWriter, for prettier output. The console writer is configured to exclude the timestamp field, and to exclude the log level output for the info level to reduce output verbosity. See: https://github.com/rs/zerolog/?tab=readme-ov-file#pretty-logging.
func PreRunESetup ¶
PreRunESetup configures the global Logger based on LogLevel and LogOutput values. Should be called from (or by) a Cobra command's PreRunE function. Features: • Thread-safe, non-blocking logging via diode wrapper • Supports stdout, stderr, discard, or file output • Sets logger on command context
TODO_CONSIDERATION: Apply this pattern to all CLI commands.
Types ¶
This section is empty.