appendJSONIfDebug appends JSON data to a message only if the global log level is Debug
(message string, data map[string]interface{})
| 10 | |
| 11 | // appendJSONIfDebug appends JSON data to a message only if the global log level is Debug |
| 12 | func appendJSONIfDebug(message string, data map[string]interface{}) string { |
| 13 | if internal.LogLevel.DebugOrAbove() { |
| 14 | jsonData, _ := json.Marshal(data) |
| 15 | return fmt.Sprintf("%s %s", message, string(jsonData)) |
| 16 | } |
| 17 | return message |
| 18 | } |
| 19 | |
| 20 | const ( |
| 21 | // ======================================== |
no test coverage detected