Page MenuHomePhabricator

util: Log early messages
ClosedPublic

Authored by Fabien on Mar 24 2020, 12:52.

Details

Summary
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.

Backport of core PR16112.

Test Plan
ninja check check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.Mar 24 2020, 13:47
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/logging.h
65 ↗(On Diff #17140)

Why not an actual annotation rather than a comment?

This revision now requires changes to proceed.Mar 24 2020, 13:47
Fabien requested review of this revision.Mar 24 2020, 13:56
Fabien added inline comments.
src/logging.h
65 ↗(On Diff #17140)

My understanding is that by not using the sync.h wrappers, the lock annotations (EXCLUSIVE_LOCK_FUNCTION(), UNLOCK_FUNCTION(), ...) are missing and GUARDED_BY() cannot be evaluated.

This revision is now accepted and ready to land.Mar 25 2020, 18:40
This revision was automatically updated to reflect the committed changes.