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.
pull/29798/head
Vasil Dimov 7 months ago
parent 8c6f3bf163
commit 74dd33cb0a
No known key found for this signature in database
GPG Key ID: 54DF06F64B55CBBF

@ -219,10 +219,6 @@ bool GetLogCategory(BCLog::LogFlags& flag, std::string_view str)
flag = BCLog::ALL; flag = BCLog::ALL;
return true; return true;
} }
if (str == "0") {
flag = BCLog::NONE;
return true;
}
auto it = LOG_CATEGORIES_BY_STR.find(str); auto it = LOG_CATEGORIES_BY_STR.find(str);
if (it != LOG_CATEGORIES_BY_STR.end()) { if (it != LOG_CATEGORIES_BY_STR.end()) {
flag = it->second; flag = it->second;

@ -221,7 +221,6 @@ static RPCHelpMan logging()
"The valid logging categories are: " + LogInstance().LogCategoriesString() + "\n" "The valid logging categories are: " + LogInstance().LogCategoriesString() + "\n"
"In addition, the following are available as category names with special meanings:\n" "In addition, the following are available as category names with special meanings:\n"
" - \"all\", \"1\" : represent all logging categories.\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", {"include", RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "The categories to add to debug logging",

Loading…
Cancel
Save