Function
addStringFieldWithDefaults
(ctx context.Context, m map[string]string, fieldKey Key)
Source from the content-addressed store, hash-verified
| 167 | } |
| 168 | |
| 169 | func addStringFieldWithDefaults(ctx context.Context, m map[string]string, fieldKey Key) { |
| 170 | val := ctx.Value(fieldKey) |
| 171 | if val == nil { |
| 172 | val = "" |
| 173 | } |
| 174 | |
| 175 | m[fieldKey.String()] = val.(string) |
| 176 | } |
| 177 | |
| 178 | // GetLogFields gets a map of all known logKeys set on the context. logKeys are special and should be used in case, |
| 179 | // context fields are to be added to the log lines. |
Tested by
no test coverage detected