MCPcopy
hub / github.com/uber-go/zap / NewDevelopmentEncoderConfig

Function NewDevelopmentEncoderConfig

config.go:200–216  ·  view source on GitHub ↗

NewDevelopmentEncoderConfig returns an opinionated EncoderConfig for development environments. Messages encoded with this configuration will use Zap's console encoder intended to print human-readable output. It will print log messages with the following information: - The log level (e.g. "INFO", "

()

Source from the content-addressed store, hash-verified

198// cfg := zap.NewDevelopmentEncoderConfig()
199// cfg.EncodeTime = zapcore.ISO8601TimeEncoder
200func NewDevelopmentEncoderConfig() zapcore.EncoderConfig {
201 return zapcore.EncoderConfig{
202 // Keys can be anything except the empty string.
203 TimeKey: "T",
204 LevelKey: "L",
205 NameKey: "N",
206 CallerKey: "C",
207 FunctionKey: zapcore.OmitKey,
208 MessageKey: "M",
209 StacktraceKey: "S",
210 LineEnding: zapcore.DefaultLineEnding,
211 EncodeLevel: zapcore.CapitalLevelEncoder,
212 EncodeTime: zapcore.ISO8601TimeEncoder,
213 EncodeDuration: zapcore.StringDurationEncoder,
214 EncodeCaller: zapcore.ShortCallerEncoder,
215 }
216}
217
218// NewDevelopmentConfig builds a reasonable default development logging
219// configuration.

Callers 5

withLoggerFunction · 0.92
NewLoggerFunction · 0.92
NewDevelopmentConfigFunction · 0.85

Calls

no outgoing calls

Tested by 3

withLoggerFunction · 0.74