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

Function FromContext

pkg/util/spanlogger/spanlogger.go:61–63  ·  view source on GitHub ↗

FromContext returns a span logger using the current parent span. If there is no parent span, the SpanLogger will only log to the logger in the context. If the context doesn't have a logger, the global logger is used.

(ctx context.Context)

Source from the content-addressed store, hash-verified

59// in the context. If the context doesn't have a logger, the global logger
60// is used.
61func FromContext(ctx context.Context) *SpanLogger {
62 return FromContextWithFallback(ctx, util_log.Logger)
63}
64
65// FromContextWithFallback returns a span logger using the current parent span.
66// IF there is no parent span, the SpanLogger will only log to the logger

Callers 7

validateQueryTimeRangeFunction · 0.92
fetchSeriesFromStoresMethod · 0.92
TestMethod · 0.92
TestMethod · 0.92
TestSpanLogger_LogFunction · 0.70

Calls 1

FromContextWithFallbackFunction · 0.85

Tested by 1

TestSpanLogger_LogFunction · 0.56