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.
func NewVersionCommand ¶
NewVersionCommand create a new cobra.Command to print the version information.
Types ¶
type IO ¶
IO contains an input reader, an output writer and an error writer.
func NewBufferedIO ¶ added in v0.3.0
func NewBufferedIO() *IO
type LoggingMode ¶
type LoggingMode int
LoggingMode represents a logging configuration specification.
const ( LoggingNop LoggingMode = iota LoggingVerbose LoggingDebug )
LoggingMode values
Click to show internal directories.
Click to hide internal directories.