aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2024-07-26 07:42:08 -0400
committerRyan Ofsky <ryan@ofsky.org>2024-07-26 08:06:08 -0400
commit30cef53707fb62ab1c9e73c2b5bc8b006e0613d3 (patch)
treec564d697560aab6674a84e16f7e310a319c766a3 /src/net_processing.cpp
parent123888dcb8f8027fa35026d9a95dec30a00caef6 (diff)
parentb4dd7ab43e8cfc2c171f67588e4e1ec2705393c2 (diff)
Merge bitcoin/bitcoin#30386: Early logging improvements
b4dd7ab43e8cfc2c171f67588e4e1ec2705393c2 logging: use std::string_view (Anthony Towns) 558df5c733d31456faf856d44f7037f41981d797 logging: Apply formatting to early log messages (Anthony Towns) 6cf9b344409efcc41a2b34f87100d25e1d2486af logging: Limit early logging buffer (Anthony Towns) 0b1960f1b29cfe5209ac68102c8643fc9553f247 logging: Add DisableLogging() (Anthony Towns) 6bbc2dd6c50f09ff1e70423dc29a404b570f5b69 logging: Add thread safety annotations (Anthony Towns) Pull request description: In order to cope gracefully with `Log*()` calls that are invoked prior to logging being fully configured (indicated by calling `StartLogging()` we buffer early log messages in `m_msgs_before_open`. This has a couple of minor issues: * if there are many such log messages the buffer can become arbitrarily large; this can be a problem for users of libkernel that might not wish to worry about logging at all, and as a result never invoke `StartLogging()` * early log messages are formatted before the formatting options are configured, leading to inconsistent output Fix those issues by buffering the log info prior to formatting it, and setting a limit on the size of the buffer (dropping the oldest lines, and reporting the number of lines skipped). Also adds some thread safety annotations, and the ability to invoke `LogInstance().DisableLogging()` if you want to disable logging entirely, for a minor efficiency improvement. ACKs for top commit: maflcko: re-ACK b4dd7ab43e8cfc2c171f67588e4e1ec2705393c2 🕴 ryanofsky: Code review ACK b4dd7ab43e8cfc2c171f67588e4e1ec2705393c2 TheCharlatan: Nice, ACK b4dd7ab43e8cfc2c171f67588e4e1ec2705393c2 Tree-SHA512: 966660181276939225a9f776de6ee0665e44577d2ee9cc76b06c8937297217482e6e426bdc5772d1ce533a0ba093a8556b6a50857d4c876ad8923e432a200440
Diffstat (limited to 'src/net_processing.cpp')
0 files changed, 0 insertions, 0 deletions