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

Method Log

pkg/util/log/log.go:94–105  ·  view source on GitHub ↗

Log increments the appropriate Prometheus counter depending on the log level.

(kv ...any)

Source from the content-addressed store, hash-verified

92
93// Log increments the appropriate Prometheus counter depending on the log level.
94func (pl *PrometheusLogger) Log(kv ...any) error {
95 pl.logger.Log(kv...)
96 l := "unknown"
97 for i := 1; i < len(kv); i += 2 {
98 if v, ok := kv[i].(level.Value); ok {
99 l = v.String()
100 break
101 }
102 }
103 logMessages.WithLabelValues(l).Inc()
104 return nil
105}
106
107// CheckFatal prints an error and exits with error code 1 if err is non-nil
108func CheckFatal(location string, err error) {

Callers 15

ScanUsersMethod · 0.45
ScanUsersMethod · 0.45
readFunction · 0.45
startMethod · 0.45
stopMethod · 0.45
waitForModulesToStopMethod · 0.45
SetMethod · 0.45
iterationMethod · 0.45
HandlerFunction · 0.45
OTLPHandlerFunction · 0.45
convertToPromTSFunction · 0.45
TestInitLoggerFunction · 0.45

Calls 2

StringMethod · 0.65
IncMethod · 0.45

Tested by 2

TestInitLoggerFunction · 0.36