mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:50:37 +00:00
log: Remove trailing and embedded newlines from log messages #36904
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36904
Loading…
Reference in a new issue
No description provided.
Delete branch "2611-less-trailing-newline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The log functions sometimes have a trailing newline character. This is perfectly fine, because that char will be stripped again by the log framework. However, it is still confusing:
So remove them, and also fix a few places to remove embedded newlines.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
WalletBatchwrite failures by achow101)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive linked from the Review report for their assessments.
🟠 Minor · Qt transaction debug view loses per-input and per-output line breaks
When a log category is enabled, flattening
CTransaction::ToString()makes the Qt transaction-details debug view display the transaction as one wrapped paragraph.Location:
src/primitives/transaction.cpp:124(head).🔵 Suggestion · Rewritten
CTransaction::ToString()lacks output assertionsExisting tests do not check the rewritten formatter's full txid, counts or input/witness grouping, so they would miss omissions or incorrect field substitutions.
Location:
src/primitives/transaction.cpp:118(head).Review coverage was incomplete.
Reviewed:
fabb68d43103· Review report · Previous reportspermalink
🐙 This pull request conflicts with the target branch and needs rebase.
Ok, went ahead to exclude all reviewed pull requests in the scripted-diff. All remaining conflicts don't have any current review, or are waiting to have their reviews addressed in a push anyway.
Edit: Also pushed a fix to remove the last embedded newlines. Can be tested with something like:
🐙 This pull request conflicts with the target branch and needs rebase.
Concept ACK
nit: One log format string still has embedded newlines after the
CommitTransactionfix, theLogWarning("\n\n************************\n%s", message)inPrintExceptionContinue, which predates this PR.In
feature_init.pyit comes out indebug.logas\x0a\x0a************************\x0aEXCEPTION: ....Thx, added a fix for that as well. Can be tested via:
and then:
bitcoind -printtoconsole=1.Before:
[init] [util/exception.cpp:39] [PrintExceptionContinue] [warning] \x0a\x0a************************\x0aEXCEPTION: St13runtime_error \x0ahi \x0abitcoin in AppInit()After:
[init] [util/exception.cpp:33] [PrintExceptionContinue] [warning] ***** EXCEPTION thread: init, caught at: bitcoind.cpp:246 type: St13runtime_error what: "hi"🐙 This pull request conflicts with the target branch and needs rebase.
Concept ACK