forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logging: replace global and category log levels with atomic int
Since we have reduced how much log levels can be configured (error, warning and info are always logged; and only debug and trace levels can be disabled), we only need two bits per category to store the information. We can do this with two atomic ints, one for whether -debug is enabled, and the other for whether -trace is enabled. This allows `WillLogCategoryLevel` to avoid taking a mutex, potentially allowing for better performance in the event that multiple threads are running many LogDebug(..) statements over categories that do not have -debug enabled (or LogTrace/-trace).
- Loading branch information
Showing
4 changed files
with
53 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters