MCPcopy
hub / github.com/kopia/kopia / jsonOrConsoleEncoder

Method jsonOrConsoleEncoder

internal/logfile/logfile.go:284–290  ·  view source on GitHub ↗

nolint:gocritic

(ec zaplogutil.StdConsoleEncoderConfig, jc zapcore.EncoderConfig, isJSON bool)

Source from the content-addressed store, hash-verified

282
283//nolint:gocritic
284func (c *loggingFlags) jsonOrConsoleEncoder(ec zaplogutil.StdConsoleEncoderConfig, jc zapcore.EncoderConfig, isJSON bool) zapcore.Encoder {
285 if isJSON {
286 return zapcore.NewJSONEncoder(jc)
287 }
288
289 return zaplogutil.NewStdConsoleEncoder(ec)
290}
291
292func shouldSweepLog(maxFiles int, maxAge time.Duration) bool {
293 return maxFiles > 0 || maxAge > 0

Callers 2

setupConsoleCoreMethod · 0.95
setupLogFileCoreMethod · 0.95

Calls 1

NewStdConsoleEncoderFunction · 0.92

Tested by

no test coverage detected