30@@ -31,7 +31,7 @@ void AddLoggingArgs(ArgsManager& argsman)
31 ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
32 argsman.AddArg("-debugexclude=<category>", "Exclude debug and trace logging for a category. Can be used in conjunction with -debug=1 to output debug and trace logging for all categories except the specified category. This option can be specified multiple times to exclude multiple categories.", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
33 argsman.AddArg("-logips", strprintf("Include IP addresses in debug output (default: %u)", DEFAULT_LOGIPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
34- argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC: %s (default=%s); warning and error levels are always logged. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelsString(), LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
35+ argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC. Possible values are %s (default=%s). The following levels are always logged: info, warning, error. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelsString(), LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
LGTM. Since we’re already hardcoding “info, warning, error”, should we hardcode the allowed levels too and exclude (just in docs) warning
and error
to make it more clear that warning
and error
are really just info
?
0 argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC. Possible values are info, debug, trace (default=%s). The following levels are always logged: info, warning, error. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
Thanks! On current master, I think warning
and error
are already excluded from the allowed levels (if I correctly understand the suggestion).
0$ ./src/bitcoind -regtest -help-debug | grep -A12 loglevel=
1 -loglevel=<level>|<category>:<level>
2 Set the global or per-category severity level for logging categories
3 enabled with the -debug configuration option or the logging RPC:
4 info, debug, trace (default=debug); warning and error levels are
5 always logged. If <category>:<level> is supplied, the setting
6 will override the global one and may be specified multiple times
7 to set multiple category-specific levels. <category> can be:
Edit: updated the pull description to show the help doc before/after.
Sorry I didn’t check and just assumed it printed all levels 🤦 resolved indeed.