Documentation ¶
Index ¶
Constants ¶
View Source
const ( // LogVerbosityInfo is the verbosity level for info logging. LogVerbosityInfo = 0 // LogVerbosityDebug is the verbosity level for debug logging. LogVerbosityDebug = 2 // LogVerbosityTrace is the verbosity level for trace logging. LogVerbosityTrace = 9 )
View Source
const ( // LogFormatText specifies a textual log format. LogFormatText = "text" // LogFormatJSON specifies a JSON log format. LogFormatJSON = "json" )
View Source
const LoggerKey loggerCtxKeyType = "flintlockd.logger"
LoggerKey is the key to use for the logger in the context.
Variables ¶
View Source
var ErrLogOutputRequired = errors.New("you must specify a log output")
ErrLogOutputRequired is used when no log output is specified.
Functions ¶
func AddFlagsToCommand ¶
AddFlagsToCommand will add the logging flags to the supplied command and bind to the provided config.
func IsInvalidLogFormat ¶
IsInvalidLogFormat tests an error to see if its a invalid log format error.
Types ¶
type Config ¶
type Config struct { // Verbosity specifies the logging verbosity level. Verbosity int // Format specifies the logging output format. Format string // Output specifies the destination for logging. You can specify the special // values of 'stderr' or 'stdout' or a file path. Output string }
Config represents the configuration settings for a logger.
Click to show internal directories.
Click to hide internal directories.