From 74dd33cb0a967086df32e5140d58843ca1359d81 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Wed, 3 Apr 2024 12:57:25 +0200 Subject: [PATCH] rpc: make logging method reject "0" category and correct the help text Current logging RPC method documentation claims to accept "0" and "none" categories, but the "none" argument is actually rejected and the "0" argument is ignored. Update the implementation to refuse both categories, and remove the help text claiming to support them. --- src/logging.cpp | 4 ---- src/rpc/node.cpp | 1 - 2 files changed, 5 deletions(-) diff --git a/src/logging.cpp b/src/logging.cpp index 175eae2cc95..9a54a12b426 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -219,10 +219,6 @@ bool GetLogCategory(BCLog::LogFlags& flag, std::string_view str) flag = BCLog::ALL; return true; } - if (str == "0") { - flag = BCLog::NONE; - return true; - } auto it = LOG_CATEGORIES_BY_STR.find(str); if (it != LOG_CATEGORIES_BY_STR.end()) { flag = it->second; diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp index 65b0a93cdd5..54e2c8e226f 100644 --- a/src/rpc/node.cpp +++ b/src/rpc/node.cpp @@ -221,7 +221,6 @@ static RPCHelpMan logging() "The valid logging categories are: " + LogInstance().LogCategoriesString() + "\n" "In addition, the following are available as category names with special meanings:\n" " - \"all\", \"1\" : represent all logging categories.\n" - " - \"none\", \"0\" : even if other logging categories are specified, ignore all of them.\n" , { {"include", RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "The categories to add to debug logging",