Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DebugLogConfig is used to generate a *zap.Logger for debug mode. DebugLogConfig = func() zap.Config { cfg := zap.NewProductionConfig() cfg.Level = zap.NewAtomicLevelAt(zapcore.DebugLevel) cfg.DisableStacktrace = true return cfg }() // VerboseLogConfig is used to generate a *zap.Logger for verbose mode. VerboseLogConfig = func() zap.Config { cfg := zap.NewDevelopmentConfig() cfg.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder cfg.Level = zap.NewAtomicLevelAt(zapcore.InfoLevel) cfg.EncoderConfig.EncodeTime = func(t time.Time, enc zapcore.PrimitiveArrayEncoder) { enc.AppendString(t.Local().Format("2006-01-02 15:04:05 MST")) } return cfg }() )
Functions ¶
func AddLoggingFlags ¶
AddLoggingFlags sets "--debug" and "--verbose" flags to the given *cobra.Command instance.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.