Documentation ¶
Overview ¶
Package logutil implements various log utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogLevel = "info"
View Source
var DefaultZapLoggerConfig = zap.Config{ Level: zap.NewAtomicLevelAt(ConvertToZapLevel(DefaultLogLevel)), Development: false, Sampling: &zap.SamplingConfig{ Initial: 100, Thereafter: 100, }, Encoding: "json", EncoderConfig: zapcore.EncoderConfig{ TimeKey: "ts", LevelKey: "level", NameKey: "logger", CallerKey: "caller", MessageKey: "msg", StacktraceKey: "stacktrace", LineEnding: zapcore.DefaultLineEnding, EncodeLevel: zapcore.LowercaseLevelEncoder, EncodeTime: zapcore.ISO8601TimeEncoder, EncodeDuration: zapcore.StringDurationEncoder, EncodeCaller: zapcore.ShortCallerEncoder, }, OutputPaths: []string{"stderr"}, ErrorOutputPaths: []string{"stderr"}, }
DefaultZapLoggerConfig defines default zap logger configuration.
Functions ¶
func AddOutputPaths ¶
AddOutputPaths adds output paths to the existing output paths, resolving conflicts.
func ConvertToZapLevel ¶
ConvertToZapLevel converts log level string to zapcore.Level.
func GetDefaultZapLogger ¶
GetDefaultZapLogger returns a new default logger.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.