New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change LogAcceptCategory to use uint32_t rather than sets of strings. #9424
Conversation
If we ever need more than 32 categories (there are 19 now) this could be trivially changed to use a uint64_t. |
src/net_processing.cpp
Outdated
if ((fDebug && vInv.size() > 0) || (vInv.size() == 1)) | ||
LogPrint("net", "received getdata for: %s peer=%d\n", vInv[0].ToString(), pfrom->id); | ||
if (vInv.size() > 0) | ||
LogPrint(LOG_NET, "received getdata for: %s peer=%d\n", vInv[0].ToString(), pfrom->id); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prior code above struck me as somewhat brain-damaged (LogPrint() does nothing when fDebug isn't true), so this chunk could use some more review attention in case I was missing something.
src/util.h
Outdated
@@ -69,15 +70,50 @@ inline std::string _(const char* psz) | |||
void SetupEnvironment(); | |||
bool SetupNetworking(); | |||
|
|||
enum LogFlags : uint32_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea: Would be easier to maintain if it was possible to define LogFlags and CLogCategoryDesc in the same section...
One week, no substantive feedback. Closing. |
Concept ACK |
Please reopen. Holidays... Concept ACK |
concept ACK |
utACK e348647315b619e6a1d8b614554abb0747047696 |
Needs rebase. |
@gmaxwell Please reopen this... |
Concept ACK, seems to be a great PR with serval acks. Needs rebase and reopen. |
Concept ACK |
Definite concept ACK. Makes #10123 trivial. |
Concept ACK. |
src/util.h
Outdated
@@ -69,15 +70,50 @@ inline std::string _(const char* psz) | |||
void SetupEnvironment(); | |||
bool SetupNetworking(); | |||
|
|||
enum LogFlags : uint32_t { | |||
LOG_NONE = 0, | |||
LOG_NET = (1 << 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the LOG_ prefix, I'd propose to use a scoped enum. E.g. LogFlags::NONE
LogFlags::NET
etc.
(defined using enum class LogFlags
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh darn, didn't see this until I'd already done the rebase. Uh, I'll look into it and put it as a commit on top for squashing. (presumably it'll be a more or less trivial change that could be reviewed separately)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19:32 < gmaxwell> wumpus: uh. so boolean operations don't appear to exist for scoped enums. so ... I don't think I can use them without
defining a set of boolean operations for them.
19:32 < sipa> gmaxwell: eh?
19:33 < sipa> ah, scoped enums don't have an implicit conversion to int
19:34 < sipa> you can still explicitly convert them, though
19:34 < sipa> but enums are generally a bad approach for bitfields, as they're intended to be exhaustive
19:34 < gmaxwell> sipa: wumpus suggested that I change the log print thing to use a scoped enum. The original thing that inspired this
change is that rebroad wanted to do some horrible hack to do the logical equivilent of LogPrint(LOG_NET | LOG_MEMPOOL,
...). (and of course the matching also uses it as a bitfield.)
19:35 < sipa> right, a normal enum (which behaves much more like an int) may be more appropriate
19:35 < gmaxwell> well thats what I implemented.
19:37 < sipa> awesöme
19:37 < gmaxwell> in any case. I'm happy to change it to whatever. someone who has an opinion needs to tell me what to do. I think I only
need a couple casts to make the enum class stuff go, but it would be ugly to do "LogPrint(LOG_NET | LOG_MEMPOOL," later
unless we provide | for the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just that the LOG_ prefix is very common, so it's easy to get namespace collisions. Scoped enums avoid that, the only way any of their members can collide is when the name of the type conflicts, which would be an error in the first place.
Then again if this introduces extra C++ casting uglyness in all usages let's leave it like this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could make it BCLOG or something like that, you're right about namespace collisions, my initial sed through to rename the LOG_ accidentally renamed some things it shouldn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another approach would be wrapping it in a C++ namespace (for example:
namespace bclog {
enum flags {
NET,
MEMPOOL,
...
};
}
at which point you can use bclog::NET | bclog::MEMPOOL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK!
I think it would be nice if there were a semi-convenient way to add new categories without triggering a big recompile though...
src/util.h
Outdated
|
||
template<typename... Args> | ||
static inline int LogPrint(const char* category, const char* fmt, const Args&... args) | ||
static inline int LogPrint(uint32_t category, const char* fmt, const Args&... args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type should maybe be LogFlags for future upgrades.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would add some type safety. It would make it more of a hassle to submit a message to more categories at once but that isn't supported now either.
@@ -56,6 +55,8 @@ extern CTranslationInterface translationInterface; | |||
extern const char * const BITCOIN_CONF_FILENAME; | |||
extern const char * const BITCOIN_PID_FILENAME; | |||
|
|||
extern std::atomic<uint32_t> logCategories; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this set on init single threadedly? Maybe you can drop the atomics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect the very next logical change will be to add an RPC to turn on and off logging categories. Since all the reads are order relaxed I expect it to emit the same code as a non-atomic read (at least on x86).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've wanted this for so long! Consider this the next/2 logical change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes being able to change the debug flags at runtime (even if not the libevent and leveldb ones which are processed at startup) would be nice.
Suggestion on how to make the category more extensible without triggering big recompiles: #define LogPrint(cat, ...) _LogPrint(cat, #cat, __VA_ARGS__)
static inline int _LogPrint(uint32_t category, const char* category_str, const char* fmt, const Args&... args) {
// ...
if (category == LOG_USE_IDENT_NAME)
// use the macro
// ...
} then from static const uint32_t LOG_SOMEFILE = LOG_USE_IDENT_NAME;
LogPrint(LOG_SOMEFILE, "...");
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me like there are a couple of rebase errors here. Other than that a few nits but looks good. I've tested ab53beaf9c0d8f923f24a50b373968a8c01760d4 manually and against the extended test suite and it works.
One thing to note about the future logging RPC work: I think libevent and leveldb logging levels are set at start up, so they won't be modifiable through the RPC without some additional work. Not a problem for this PR, but something to note since it'd be easy to believe that just updating logCategories would be enough. Perhaps worth putting a comment next to the logCategories variable warning about this?
src/util.h
Outdated
/** Returns a string with the supported log categories */ | ||
std::string ListLogCategories(); | ||
|
||
/** Return true of str parses as a log category and set the flags in f */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/of/if
src/util.h
Outdated
std::string ListLogCategories(); | ||
|
||
/** Return true of str parses as a log category and set the flags in f */ | ||
bool ParseLogCategory(uint32_t *f, const std::string *str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer a name like SetLogCategory
. Parse suggests no side-effects to me.
src/util.cpp
Outdated
{LOG_COINDB, "coindb"}, | ||
{LOG_QT, "qt"}, | ||
{LOG_LEVELDB, "leveldb"}, | ||
{LOG_ALL, "1"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an "all" alias here, ie -debug=all
is equivalent to -debug=1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup.
src/init.cpp
Outdated
@@ -908,12 +905,23 @@ bool AppInitParameterInteraction() | |||
|
|||
// ********************************************************* Step 3: parameter-to-internal-flags | |||
|
|||
fDebug = mapMultiArgs.count("-debug"); | |||
bool fDebug = mapMultiArgs.count("-debug") > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you've removed the global fDebug bool, you can go ahead and remove it entirely and test the conditions directly (rather than make the variable local), ie:
if (mapMultiArgs.count("-debug") > 0) {
and further below:
if !(GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), std::string("0")) != categories.end()) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point.
src/util.h
Outdated
LogPrintf(__VA_ARGS__); \ | ||
} \ | ||
} while(0) | ||
#define LogPrintf(...) LogPrintStr(tfm::format(__VA_ARGS__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you removed the try/except handling in this macro? (I'm not saying it's wrong, I just don't understand why it was necessary before but not now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: I think this is a bad rebase that's reverted #9963
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Fixing.
src/tinyformat.h
Outdated
@@ -167,7 +167,7 @@ namespace tinyformat { | |||
class format_error: public std::runtime_error | |||
{ | |||
public: | |||
format_error(const std::string &what): std::runtime_error(what) { | |||
format_error(const std::string &fmtwhat): std::runtime_error(fmtwhat) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad rebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. silencing an obnoxious shadowing warning that was making it impossible to see where other issues were.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just disable the shadowing warnings please, instead of peppering unrelated variable renames in commits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There you go: #10136
I think I addressed all the comments. |
IMO we shouldn't worry about recompiles when the set of categories changes. That's a rare occurrence, and the way headers depend on each other almost every header change already results in a (near) full recompile. |
utACK 21d94e7 apart from the parameter name change in |
This changes the logging categories to boolean flags instead of strings. This simplifies the acceptance testing by avoiding accessing a scoped static thread local pointer to a thread local set of strings. It eliminates the only use of boost::thread_specific_ptr outside of lockorder debugging. This change allows log entries to be directed to multiple categories and makes it easy to change the logging flags at runtime (e.g. via an RPC, though that isn't done by this commit.) It also eliminates the fDebug global. Configuration of unknown logging categories now produces a warning.
(Trivally) rebased, squashed, and removed the tinyformat change. |
Going to merge this; a change like this will need rebase after every single thing that gets merged, and @gmaxwell addressed all the nits. Further improvements can be done in later PRs. |
…s of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> # Conflicts: # src/httpserver.cpp # src/init.cpp # src/net.cpp # src/net_processing.cpp # src/policy/fees.cpp # src/txdb.cpp # src/util.cpp # src/util.h # src/validation.cpp # src/wallet/rpcwallet.cpp # src/wallet/wallet.cpp # src/zmq/zmqpublishnotifier.cpp
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org>
* Contains dashification. disables `-debug dash` Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org> * Merge bitcoin#10123: Allow debug logs to be excluded from specified component 3bde556 Add -debugexclude option to switch off logging for specified components (John Newbery) Tree-SHA512: 30202e3f2085fc2fc5dd4bedb92988f4cb162c612a42cf8f6395a7da326f34975ddc347f82bc4ddca6c84c438dc0cc6e87869f90c7ff88105dbeaa52a947fa43 * bump to uint64_t due to added Dash codes Signed-off-by: Pasta <Pasta@dash.org> * bump to uint64_t due to added Dash codes cont. Signed-off-by: Pasta <Pasta@dash.org> * string -> BCLog format Signed-off-by: Pasta <Pasta@dash.org> * uint32_t -> uint64_t Signed-off-by: Pasta <Pasta@dash.org> * Fix CBatchedLogger * Fix most fDebug-s * Fix `debug` rpc * Fix BENCH and RAND conflicts * Add ALERT and use it * Update LogPrint-s in dash-specific code * Tweak few log categories Specifically: - use PRIVATESEND in `CPrivateSendClientManager::GetRandomNotUsedMasternode()` - use ZMQ in `CZMQPublishRawGovernanceVoteNotifier::NotifyGovernanceVote()` and `CZMQPublishRawGovernanceObjectNotifier::NotifyGovernanceObject()` * Drop no longer used MASTERNODE category * Merge bitcoin#10153: logging: Fix off-by-one for shrinkdebugfile default faab624 logging: Fix off-by-one for shrinkdebugfile (MarcoFalke) Tree-SHA512: d6153e06067906172ff0611af9e585a3ecf0a7d56925b6ad7c12e75aa802441047059b9b6f6c78e79916c3f2abc8f1998bfd2d5b84201ec6421f727c08da3c21 * Shift dash-specific log categories to start from `1ul << 32` to avoid potential future conflicts with bitcoin ones * Fix `dash` category * remove debugCategories Signed-off-by: Pasta <Pasta@dash.org> * Prepend "std::" to find call * Check for BCLog::PRIVATESEND instead of logCategories != BCLog::NONE * Use BCLog::MNPAYMENTS category instead of checking for logCategories != BCLog::NONE * Move "End Dash" comment below "ALERT" When adding new entries here, we'll otherwise get confused with ordering and might end up forgetting that adding something Dash specific must continue with the bit after 43.
* Contains dashification. disables `-debug dash` Merge bitcoin#9424: Change LogAcceptCategory to use uint32_t rather than sets of strings. 6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell) Tree-SHA512: ebb5bcf9a7d00a32dd1390b727ff4d29330a038423611da01268d8e1d2c0229e52a1098e751d4e6db73ef4ae862e1e96d38249883fcaf12b68f55ebb01035b34 Signed-off-by: Pasta <Pasta@dash.org> 31 -> 32 Signed-off-by: Pasta <Pasta@dash.org> * Merge bitcoin#10123: Allow debug logs to be excluded from specified component 3bde556 Add -debugexclude option to switch off logging for specified components (John Newbery) Tree-SHA512: 30202e3f2085fc2fc5dd4bedb92988f4cb162c612a42cf8f6395a7da326f34975ddc347f82bc4ddca6c84c438dc0cc6e87869f90c7ff88105dbeaa52a947fa43 * bump to uint64_t due to added Dash codes Signed-off-by: Pasta <Pasta@dash.org> * bump to uint64_t due to added Dash codes cont. Signed-off-by: Pasta <Pasta@dash.org> * string -> BCLog format Signed-off-by: Pasta <Pasta@dash.org> * uint32_t -> uint64_t Signed-off-by: Pasta <Pasta@dash.org> * Fix CBatchedLogger * Fix most fDebug-s * Fix `debug` rpc * Fix BENCH and RAND conflicts * Add ALERT and use it * Update LogPrint-s in dash-specific code * Tweak few log categories Specifically: - use PRIVATESEND in `CPrivateSendClientManager::GetRandomNotUsedMasternode()` - use ZMQ in `CZMQPublishRawGovernanceVoteNotifier::NotifyGovernanceVote()` and `CZMQPublishRawGovernanceObjectNotifier::NotifyGovernanceObject()` * Drop no longer used MASTERNODE category * Merge bitcoin#10153: logging: Fix off-by-one for shrinkdebugfile default faab624 logging: Fix off-by-one for shrinkdebugfile (MarcoFalke) Tree-SHA512: d6153e06067906172ff0611af9e585a3ecf0a7d56925b6ad7c12e75aa802441047059b9b6f6c78e79916c3f2abc8f1998bfd2d5b84201ec6421f727c08da3c21 * Shift dash-specific log categories to start from `1ul << 32` to avoid potential future conflicts with bitcoin ones * Fix `dash` category * remove debugCategories Signed-off-by: Pasta <Pasta@dash.org> * Prepend "std::" to find call * Check for BCLog::PRIVATESEND instead of logCategories != BCLog::NONE * Use BCLog::MNPAYMENTS category instead of checking for logCategories != BCLog::NONE * Move "End Dash" comment below "ALERT" When adding new entries here, we'll otherwise get confused with ordering and might end up forgetting that adding something Dash specific must continue with the bit after 43.
…of strings c3dc816 [Core] LogAcceptCategory: use uint32_t rather than sets of strings (random-zebra) Pull request description: implemented on top of: - [x] #1449 from bitcoin#9424 > This changes the logging categories to boolean flags instead of strings. This simplifies the acceptance testing by avoiding accessing a scoped static thread local pointer to a thread local set of strings. It eliminates the only use of boost::thread_specific_ptr outside of lockorder debugging. This change allows log entries to be directed to multiple categories and makes it easy to change the logging flags at runtime (e.g. via an RPC, though that isn't done by this commit.) It also eliminates the fDebug global. Configuration of unknown logging categories now produces a warning. We add 4 more debug categories: - BCLog::STAKING - BCLog::MASTERNODE (which includes previous "masternode" and "mnpayments" categories) - BCLog::MNBUDGET - BCLog::LEGACYZC ACKs for top commit: Fuzzbawls: ACK c3dc816 Tree-SHA512: 0c2ffc30df5b4239396c6f2ef6c551bbca5696aa1087b5e12a206fc9b1def9ef6cd9c6f6c0cbbb8da0d667e782848a884514de21609714668d0b5ad87eca8e56
This changes the logging categories to boolean flags instead of strings.
This simplifies the acceptance testing by avoiding accessing a scoped
static thread local pointer to a thread local set of strings. It
eliminates the only use of boost::thread_specific_ptr outside of
lockorder debugging.
This change allows log entries to be directed to multiple categories
and makes it easy to change the logging flags at runtime (e.g. via
an RPC, though that isn't done by this commit.)
It also eliminates the fDebug global.
Configuration of unknown logging categories now produces a warning.