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

Function GetRealtimeAPILoggerFromSpec

pkg/operator/operator/logging.go:124–136  ·  view source on GitHub ↗
(apiSpec *spec.API)

Source from the content-addressed store, hash-verified

122}
123
124func GetRealtimeAPILoggerFromSpec(apiSpec *spec.API) (*zap.SugaredLogger, error) {
125 loggerCacheKey := fmt.Sprintf("apiName=%s,apiID=%s", apiSpec.Name, apiSpec.ID)
126 logger := getFromCacheOrNil(loggerCacheKey)
127 if logger != nil {
128 return logger, nil
129 }
130
131 return initializeLogger(loggerCacheKey, userconfig.InfoLogLevel, map[string]interface{}{
132 "apiName": apiSpec.Name,
133 "apiKind": apiSpec.Kind.String(),
134 "apiID": apiSpec.ID,
135 })
136}
137
138func GetJobLogger(jobKey spec.JobKey) (*zap.SugaredLogger, error) {
139 loggerCacheKey := fmt.Sprintf("apiName=%s,jobID=%s", jobKey.APIName, jobKey.ID)

Callers

nothing calls this directly

Calls 3

getFromCacheOrNilFunction · 0.85
initializeLoggerFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected