aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorAkio Nakamura <nakamura@dgtechnologies.co.jp>2017-08-29 20:32:16 +0900
committerAkio Nakamura <nakamura@dgtechnologies.co.jp>2017-11-20 17:48:39 +0900
commitc60c49b6794279325725a5c3c1a8d3dc6764b966 (patch)
tree625962e683e4826119c099e72670f825bbdc8be8 /src/init.cpp
parenta90e6d2bffc422ddcdb771c53aac0bceb970a2c4 (diff)
Improve help text and behavior of RPC-logging
A) The changes in behavior are as follows: 1. Introduce logging category "none" as alias of "0" for both RPC-logging and bitcoind "-debug" parameter. 2. Same as "0" is given to argument of "-debug", if "none" or "0" is given to <include>, all other given logging categories are ignored. The same is true for <exclude>. (Before this PR, "0" was accepted but just be ignored itself.) B) The changes in the help text are as follows: 1. Add a descrption about the evaluation order of <include> and <exclude> to clarify how debug loggig categories to be set. 2. Delete text that describe restriction about libevent because it's already allowed libevent logging to be updated during runtime. 3. Add a description for category "all", "1", "none" and "0". 4. Add "optional" to the help text of <include> and <exclude>. 5. Add missing new lines before "Argument:". 6. This RPC always returns all logging categories with status. Fix the help text to match this behavior.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 7c99dc74ef..6149fe8d25 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -925,7 +925,8 @@ bool AppInitParameterInteraction()
// Special-case: if -debug=0/-nodebug is set, turn off debugging messages
const std::vector<std::string> categories = gArgs.GetArgs("-debug");
- if (find(categories.begin(), categories.end(), std::string("0")) == categories.end()) {
+ if (std::none_of(categories.begin(), categories.end(),
+ [](std::string cat){return cat == "0" || cat == "none";})) {
for (const auto& cat : categories) {
uint32_t flag = 0;
if (!GetLogCategory(&flag, &cat)) {