Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LogLevel is a global variable that is intended to hold the value of the // "--log-level" flag when a command which has called PreRunESetup() is executed. LogLevel string // LogOutput is a global variable that is intended to hold the value of the // "--log-output" flag when a command which has called PreRunESetup() is executed. LogOutput string // Logger is a global variable that holds the logger which is configured according // to the values of the LogLevel and LogOutput global variables in PreRunESetup(). 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 sets up the global cmd logger (Logger) for use in any subcommand. This function is intended to be passed as (or called by) a `PreRunE` function of a Cobra command.
TODO_CONSIDERATION: Apply this pattern to all CLI commands.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.