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

Function NewPrometheusLogger

pkg/util/log/log.go:63–66  ·  view source on GitHub ↗

NewPrometheusLogger creates a new instance of PrometheusLogger which exposes Prometheus counters for various log levels.

(l logging.Level, format logging.Format)

Source from the content-addressed store, hash-verified

61// NewPrometheusLogger creates a new instance of PrometheusLogger which exposes
62// Prometheus counters for various log levels.
63func NewPrometheusLogger(l logging.Level, format logging.Format) (log.Logger, error) {
64 logger := newLoggerWithFormat(format)
65 return newPrometheusLoggerFrom(logger, l), nil
66}
67
68func newLoggerWithFormat(format logging.Format) log.Logger {
69 logger := log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr))

Callers 1

mainFunction · 0.92

Calls 2

newLoggerWithFormatFunction · 0.85
newPrometheusLoggerFromFunction · 0.85

Tested by

no test coverage detected