UpdateLogKeys updates the console's log keys from a map
(ctx context.Context, keys map[string]bool, replace bool)
| 36 | |
| 37 | // UpdateLogKeys updates the console's log keys from a map |
| 38 | func UpdateLogKeys(ctx context.Context, keys map[string]bool, replace bool) { |
| 39 | if replace { |
| 40 | ConsoleLogKey().Set(logKeyMask(KeyNone)) |
| 41 | } |
| 42 | |
| 43 | for k, v := range keys { |
| 44 | key := strings.Replace(k, "+", "", -1) |
| 45 | if v { |
| 46 | ConsoleLogKey().Enable(logKeyNamesInverse[key]) |
| 47 | } else { |
| 48 | ConsoleLogKey().Disable(logKeyNamesInverse[key]) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | InfofCtx(ctx, KeyAll, "Setting log keys to: %v", ConsoleLogKey().EnabledLogKeys()) |
| 53 | } |
| 54 | |
| 55 | // Returns a string identifying a function on the call stack. |
| 56 | // Use depth=1 for the caller of the function that calls GetCallersName, etc. |
no test coverage detected