Skip to content

Commit b5640f6

Browse files
committed
Try logging just the message and not the args
1 parent 1a4a456 commit b5640f6

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

sql/analyzer/analyzer.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -295,31 +295,15 @@ func (a *Analyzer) Log(msg string, args ...interface{}) {
295295
return
296296
}
297297

298-
// Since this is debug-only code, we'll simplify to avoid the analyzer warnings
299-
// First, handle any sanitization needed for sensitive data
300-
safeArgs := make([]interface{}, len(args))
301-
for i, arg := range args {
302-
if s, ok := arg.(string); ok && isSensitiveString(s) {
303-
safeArgs[i] = "[REDACTED]"
304-
} else if _, ok := arg.(plan.AuthenticationMysqlNativePassword); ok {
305-
safeArgs[i] = "[PASSWORD_REDACTED]"
306-
} else {
307-
safeArgs[i] = arg
308-
}
309-
}
310-
311298
// Format the message with context prefix if needed
312299
if len(a.contextStack) > 0 {
313300
ctx := strings.Join(a.contextStack, "/")
314301
// Create a string with the context prefix
315-
prefixedMsg := fmt.Sprintf("%s: %s", ctx, msg)
316302
// Format the message and log it directly, avoiding variadic expansion in log calls
317-
formattedMsg := fmt.Sprintf(prefixedMsg, safeArgs...)
318-
log.Info(formattedMsg)
303+
log.Info(fmt.Sprintf("%s: %s", ctx, msg))
319304
} else {
320305
// Format the message and log it directly
321-
formattedMsg := fmt.Sprintf(msg, safeArgs...)
322-
log.Info(formattedMsg)
306+
log.Info(msg)
323307
}
324308
}
325309

0 commit comments

Comments
 (0)