Early log messages are dropped on the floor and they’d never make it to the console or debug log. This can be tested by running the test included in this pull request without re-compiling the bitcoind
.
Fix that by buffering early messages and flushing them as soon as all logging options have been initialized and logging has been started.
This pull request is identical to “Log early messages with -printtoconsole” (#13088) by ajtowns, with the following changes:
- Rebased
- Added docstrings for
m_buffering
andStartLogging
- Switch
CCriticalSection
(akaRecursiveMutex
) to justMutex
in the last commit - Added tests