mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Merge bitcoin/bitcoin#34033: scripted-diff: Unify error and warning log formatting
fa89f60e31scripted-diff: LogPrintLevel(*,BCLog::Level::*,*) -> LogError()/LogWarning() (MarcoFalke)fa6c7a1954scripted-diff: LogPrintLevel(*,BCLog::Level::Debug,*) -> LogDebug() (MarcoFalke) Pull request description: Errors and warnings should normally not happen. However, if they do happen, it is easier to spot them, if they are all logged in the same format via `LogError` or `LogWarning`. So do that with a scripted-diff. This is a minimal behavior change and unifies the log output from: [net:error] Something bad happened [net:warning] Something problematic happened to either [error] Something bad happened [warning] Something problematic happened or, when `-loglevelalways=1` is enabled: [all:error] Something bad happened [all:warning] Something problematic happened Such a behavior change is desired, because all warning and error logs are written in the same style in the source code and they are logged in the same format for log consumers. Removing the category should be harmless, because warning and error messages should be descriptive and unique anyway. ACKs for top commit: ajtowns: ACKfa89f60e31stickies-v: ACKfa89f60e31rkrux: lgtm code review ACKfa89f60e31Tree-SHA512: dafa47ab561609a79005faf008fe188dd714f6e07bb2dfbe4db49290d6636b12eb7ac4a18ed32bcc5526641a9f258dbc37c08e10c223ec068b97976590ff0b52
This commit is contained in:
@@ -2795,7 +2795,7 @@ bool Chainstate::FlushStateToDisk(
|
||||
// TODO: Handle return error, or add detailed comment why it is
|
||||
// safe to not return an error upon failure.
|
||||
if (!m_blockman.FlushChainstateBlockFile(m_chain.Height())) {
|
||||
LogPrintLevel(BCLog::VALIDATION, BCLog::Level::Warning, "%s: Failed to flush block file.\n", __func__);
|
||||
LogWarning("%s: Failed to flush block file.\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user