MCPcopy
hub / github.com/redis/go-redis / appendJSONIfDebug

Function appendJSONIfDebug

internal/maintnotifications/logs/log_messages.go:12–18  ·  view source on GitHub ↗

appendJSONIfDebug appends JSON data to a message only if the global log level is Debug

(message string, data map[string]interface{})

Source from the content-addressed store, hash-verified

10
11// appendJSONIfDebug appends JSON data to a message only if the global log level is Debug
12func 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
20const (
21 // ========================================

Callers 15

HandoffStartedFunction · 0.85
HandoffFailedFunction · 0.85
HandoffSucceededFunction · 0.85
UnrelaxedTimeoutFunction · 0.85
HandoffQueueFullFunction · 0.85
FailedToQueueHandoffFunction · 0.85
FailedToMarkForHandoffFunction · 0.85
FailedToDialNewEndpointFunction · 0.85
ReachedMaxHandoffRetriesFunction · 0.85
ProcessingNotificationFunction · 0.85

Calls 1

DebugOrAboveMethod · 0.80

Tested by

no test coverage detected