MCPcopy Index your code
hub / github.com/cortexlabs/cortex / getFromCacheOrNil

Function getFromCacheOrNil

pkg/operator/operator/logging.go:66–76  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

64}
65
66func getFromCacheOrNil(key string) *zap.SugaredLogger {
67 _loggerCache.Lock()
68 defer _loggerCache.Unlock()
69
70 item, ok := _loggerCache.m[key]
71 if ok {
72 item.lastAccess = time.Now()
73 return item.value
74 }
75 return nil
76}
77
78func initializeLogger(key string, level userconfig.LogLevel, fields map[string]interface{}) (*zap.SugaredLogger, error) {
79 loggerConfig := logging.DefaultZapConfig(level, fields)

Callers 4

GetRealtimeAPILoggerFunction · 0.85
GetJobLoggerFunction · 0.85
GetJobLoggerFromSpecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected