(apiName string, apiID string)
| 102 | } |
| 103 | |
| 104 | func GetRealtimeAPILogger(apiName string, apiID string) (*zap.SugaredLogger, error) { |
| 105 | loggerCacheKey := fmt.Sprintf("apiName=%s,apiID=%s", apiName, apiID) |
| 106 | logger := getFromCacheOrNil(loggerCacheKey) |
| 107 | |
| 108 | if logger != nil { |
| 109 | return logger, nil |
| 110 | } |
| 111 | |
| 112 | apiSpec, err := DownloadAPISpec(apiName, apiID) |
| 113 | if err != nil { |
| 114 | return nil, err |
| 115 | } |
| 116 | |
| 117 | return initializeLogger(loggerCacheKey, userconfig.InfoLogLevel, map[string]interface{}{ |
| 118 | "apiName": apiSpec.Name, |
| 119 | "apiKind": apiSpec.Kind.String(), |
| 120 | "apiID": apiSpec.ID, |
| 121 | }) |
| 122 | } |
| 123 | |
| 124 | func GetRealtimeAPILoggerFromSpec(apiSpec *spec.API) (*zap.SugaredLogger, error) { |
| 125 | loggerCacheKey := fmt.Sprintf("apiName=%s,apiID=%s", apiSpec.Name, apiSpec.ID) |
nothing calls this directly
no test coverage detected