Documentation ¶
Index ¶
Constants ¶
View Source
const ( // LogLevelEnvStr - environment variable for the setting the log level LogLevelEnvStr string = "PUREPORT_LOG_LEVEL" // LogFileEnvStr - environment variable for the location of the log file LogFileEnvStr string = "PUREPORT_LOG_FILE" // LogDisableColorStr - environment variable to disable color log output LogDisableColorStr string = "PUREPORT_LOG_NOCOLOR" )
Variables ¶
This section is empty.
Functions ¶
func SetupLogger ¶
func SetupLogger(logConfig *LogConfig)
SetupLogger configures the system logger based on the specified log configuration. Environment variables can override these values.
Types ¶
type LogConfig ¶
type LogConfig struct { Level string `desc:"One of the available log log-levels- (info, debug, error, warn)"` Location string `desc:"stdout, stderr, or the path to a file"` MaxSize int `desc:"Maximum size (in MB) of the log file before it gets rotated, default=10"` MaxBackups int `desc:"Maximum number of old log files to retain, default=2"` MaxAge int `desc:"Maximum number of days to retain old log files, default=1"` EnableColor bool `desc:"Enable color log output"` }
LogConfig contains setting for configuring the logger
func NewLogConfig ¶
func NewLogConfig() *LogConfig
NewLogConfig generate a new default logging configuration
Click to show internal directories.
Click to hide internal directories.