Documentation ¶
Index ¶
Constants ¶
View Source
const ( FilepathSplitter = "," DefaultFilepath = "stdout" DefaultMaxFileSize = 100 DefaultMaxBackups = 30 DefaultMaxAge = 30 DefaultDisableCompress = false )
View Source
const ( JSONFormat = "json" ConsoleFormat = "console" LevelEncoderCapital = "capital" LevelEncoderCapitalColor = "capitalColor" LevelEncoderColor = "color" LevelEncoderLowercase = "lowercase" TimeEncoderRFC3339Nano = "rfc3339nano" TimeEncoderRFC3339 = "rfc3339" TimeEncoderISO8601 = "iso8601" TimeEncoderMillis = "millis" TimeEncoderNanos = "nanos" TimeEncoderSecond = "second" TimeEncoderLayout = "2006-01-02 15:04:05.000000" DurationEncoderString = "string" DurationEncoderNanos = "nanos" DurationEncoderMillis = "ms" DurationEncoderSecond = "second" CallerEncoderFull = "full" CallerEncoderShort = "short" NameEncoderFull = "full" DefaultLevel = "info" DefaultIsDev = false DefaultDisableCaller = false DefaultDisableStacktrace = true // stack core will extract error stack, so zap's stack is useless DefaultFormat = ConsoleFormat DefaultEncoderMessageKey = "msg" DefaultEncoderLevelKey = "lvl" DefaultEncoderNameKey = "logger" DefaultEncoderTimeKey = "ts" DefaultEncoderCallerKey = "caller" DefaultEncoderFunctionKey = "" DefaultEncoderStacktraceKey = "stacktrace" DefaultEncoderSkipLineEncoding = false DefaultEncoderLineEnding = "\n" DefaultEncoderLevelEncoder = LevelEncoderLowercase DefaultEncoderTimeEncoder = TimeEncoderLayout DefaultEncoderDurationEncoder = DurationEncoderString DefaultEncoderCallerEncoder = CallerEncoderShort DefaultEncoderNameEncoder = NameEncoderFull DefaultEncoderConsoleSeparator = "\t" )
Variables ¶
View Source
var ( DefaultOutputPath = []string{"stdout"} DefaultErrorOutputPath = []string{"stderr"} )
Functions ¶
func DefaultConfig ¶
func DefaultEncoderConfig ¶
func DefaultEncoderConfig() zapcore.EncoderConfig
Types ¶
type Cfg ¶
type Cfg struct { Filepath string `env:"LOG_PATH" flag-long:"log-path" yaml:"filepath" flag-description:"log file path"` Format string `env:"LOG_FORMAT" flag-long:"log-format" yaml:"format" flag-description:"log line format"` MaxFileSize int `` /* 166-byte string literal not displayed */ MaxBackups int `` /* 143-byte string literal not displayed */ MaxAge int `` /* 197-byte string literal not displayed */ Level string `` /* 131-byte string literal not displayed */ DisableCompress bool `` /* 146-byte string literal not displayed */ }
Click to show internal directories.
Click to hide internal directories.