NOLINT(bitcoin-unterminated-logprintf)
is used to document a missing trailing \n
char in the format string. This has many issues:
- It is just documentation, assuming that a trailing
\n
ends up in the formatted string. It is not enforced at compile-time, so it is brittle. - If the newline was truly missing and
NOLINT(bitcoin-unterminated-logprintf)
were used to document a “continued” line, the log stream would be racy/corrupt, because any other thread may inject a log message in the meantime. - If the newline was accidentally missing, nothing is there to correct the mistake.
- The intention of all code is to always end a log line with a new line. However, historic code exists to deal with the case where the new line was missing (
m_started_new_line
). This is problematic, because the presumed dead code has to be maintained (https://github.com/bitcoin/bitcoin/pull/30386#discussion_r1682963306).
Fix almost all issues by removing the NOLINT(bitcoin-unterminated-logprintf)
, ensuring that a new line is always present.
A follow-up will remove the dead logging code.