From b7aae361b273f2f439d3b278214b7e37908c8cb0 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Fri, 28 Jun 2024 18:02:46 -0400 Subject: [PATCH] doc: Drop description of LogError messages as fatal Remove documentation that says LogError should be used for "severe problems that require the node (or a subsystem) to shut down entirely" because: - This is not how `LogError` and `Level::Error` are used currently. Of 129 current uses only 58 cases are fatal according to https://github.com/bitcoin/bitcoin/issues/30348 - "[T]here's not much benefit in a log that says "hey this error is about to cause the node to stop" -- you already get that information by seeing "Shutdown: in progress..." immediately following." according to https://github.com/bitcoin/bitcoin/pull/30347#discussion_r1659096893 --- doc/developer-notes.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index d9d5b392c5..37ee78cfb3 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -26,6 +26,7 @@ Developer Notes - [Ignoring IDE/editor files](#ignoring-ideeditor-files) - [Development guidelines](#development-guidelines) - [General Bitcoin Core](#general-bitcoin-core) + - [Logging](#logging) - [Wallet](#wallet) - [General C++](#general-c) - [C++ data structures](#c-data-structures) @@ -742,14 +743,13 @@ logging messages. They should be used as follows: attacker to fill up storage. Note that `LogPrintf(fmt, params...)` is a deprecated alias for `LogInfo`. -- `LogError(fmt, params...)` should be used in place of `LogInfo` for - severe problems that require the node (or a subsystem) to shut down - entirely (e.g., insufficient storage space). +- `LogError(fmt, params...)` should be used in place of `LogInfo` for severe + errors the node admin will need to address (e.g., failure to write data). - `LogWarning(fmt, params...)` should be used in place of `LogInfo` for - severe problems that the node admin should address, but are not - severe enough to warrant shutting down the node (e.g., system time - appears to be wrong, unknown soft fork appears to have activated). + unexpected conditions indicating potentially severe problems the node admin + should address (e.g. system time appears to be wrong, unknown soft fork + appears to have activated). - `LogTrace(BCLog::CATEGORY, fmt, params...)` should be used in place of `LogDebug` for log messages that would be unusable on a production