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

Function GetJobLoggerFromSpec

pkg/operator/operator/logging.go:152–164  ·  view source on GitHub ↗
(apiSpec *spec.API, jobKey spec.JobKey)

Source from the content-addressed store, hash-verified

150}
151
152func GetJobLoggerFromSpec(apiSpec *spec.API, jobKey spec.JobKey) (*zap.SugaredLogger, error) {
153 loggerCacheKey := fmt.Sprintf("apiName=%s,jobID=%s", jobKey.APIName, jobKey.ID)
154 logger := getFromCacheOrNil(loggerCacheKey)
155 if logger != nil {
156 return logger, nil
157 }
158
159 return initializeLogger(loggerCacheKey, userconfig.InfoLogLevel, map[string]interface{}{
160 "apiName": jobKey.APIName,
161 "apiKind": jobKey.Kind.String(),
162 "jobID": jobKey.ID,
163 })
164}

Callers

nothing calls this directly

Calls 3

getFromCacheOrNilFunction · 0.85
initializeLoggerFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected