Page MenuHomePhabricator

util: Log early messages
ClosedPublic

Authored by Fabien on Tue, Mar 24, 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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Tue, Mar 24, 12:52
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Mar 24, 12:52
teamcity edited the summary of this revision. (Show Details)Tue, Mar 24, 12:52

[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.Tue, Mar 24, 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.Tue, Mar 24, 13:47
Fabien requested review of this revision.Tue, Mar 24, 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.

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