debuggingLogger.Logf (opensearchtransport/logger.go:434) uses raw fmt.Fprintf without appending a trailing newline. This pushes newline responsibility onto every caller, and the convention is already inconsistent:
74 of 76 call sites include \n, while two in policy_chain.go (lines 176 and 203) do not.
The standard library's log.Printf appends a newline when the format string does not end with one. Our Logf should do the same.
Proposed fix
- Append
\n in Logf when format does not already end with one (matching log.Printf semantics).
- Strip the trailing
\n from all 74 call sites that currently include it.
- No change needed for the two
policy_chain.go callers that already omit it.
Risk
Logf is part of the exported Logger interface. Callers with custom implementations that already append their own newline would see double newlines until they update. This is a minor cosmetic issue and the fix aligns the interface with Go conventions (log.Printf, testing.T.Logf).
Scope
Purely internal cleanup. No behavior change beyond log formatting.
debuggingLogger.Logf(opensearchtransport/logger.go:434) uses rawfmt.Fprintfwithout appending a trailing newline. This pushes newline responsibility onto every caller, and the convention is already inconsistent:74 of 76 call sites include
\n, while two inpolicy_chain.go(lines 176 and 203) do not.The standard library's
log.Printfappends a newline when the format string does not end with one. OurLogfshould do the same.Proposed fix
\ninLogfwhenformatdoes not already end with one (matchinglog.Printfsemantics).\nfrom all 74 call sites that currently include it.policy_chain.gocallers that already omit it.Risk
Logfis part of the exportedLoggerinterface. Callers with custom implementations that already append their own newline would see double newlines until they update. This is a minor cosmetic issue and the fix aligns the interface with Go conventions (log.Printf,testing.T.Logf).Scope
Purely internal cleanup. No behavior change beyond log formatting.