MCPcopy Create free account
hub / github.com/cortexproject/cortex / newLoggerWithFormat

Function newLoggerWithFormat

pkg/util/log/log.go:68–74  ·  view source on GitHub ↗
(format logging.Format)

Source from the content-addressed store, hash-verified

66}
67
68func newLoggerWithFormat(format logging.Format) log.Logger {
69 logger := log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr))
70 if format.String() == "json" {
71 logger = log.NewJSONLogger(log.NewSyncWriter(os.Stderr))
72 }
73 return logger
74}
75
76func newPrometheusLoggerFrom(logger log.Logger, logLevel logging.Level, keyvals ...any) log.Logger {
77 // Sort the logger chain to avoid expensive log.Valuer evaluation for disallowed level.

Callers 2

InitLoggerFunction · 0.85
NewPrometheusLoggerFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected