Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 1) { | ||||
"}\n" | "}\n" | ||||
"\nResult (mode \"mallocinfo\"):\n" | "\nResult (mode \"mallocinfo\"):\n" | ||||
"\"<malloc version=\"1\">...\"\n" | "\"<malloc version=\"1\">...\"\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getmemoryinfo", "") + | HelpExampleCli("getmemoryinfo", "") + | ||||
HelpExampleRpc("getmemoryinfo", "")); | HelpExampleRpc("getmemoryinfo", "")); | ||||
} | } | ||||
std::string mode = (request.params.size() < 1 || request.params[0].isNull()) | std::string mode = | ||||
? "stats" | request.params[0].isNull() ? "stats" : request.params[0].get_str(); | ||||
: request.params[0].get_str(); | |||||
if (mode == "stats") { | if (mode == "stats") { | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("locked", RPCLockedMemoryInfo()); | obj.pushKV("locked", RPCLockedMemoryInfo()); | ||||
return obj; | return obj; | ||||
} else if (mode == "mallocinfo") { | } else if (mode == "mallocinfo") { | ||||
#ifdef HAVE_MALLOC_INFO | #ifdef HAVE_MALLOC_INFO | ||||
return RPCMallocInfo(); | return RPCMallocInfo(); | ||||
#else | #else | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
" ...\n" | " ...\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("logging", "\"[\\\"all\\\"]\" \"[\\\"http\\\"]\"") + | HelpExampleCli("logging", "\"[\\\"all\\\"]\" \"[\\\"http\\\"]\"") + | ||||
HelpExampleRpc("logging", "[\"all\"], \"[libevent]\"")); | HelpExampleRpc("logging", "[\"all\"], \"[libevent]\"")); | ||||
} | } | ||||
uint32_t original_log_categories = GetLogger().GetCategoryMask(); | uint32_t original_log_categories = GetLogger().GetCategoryMask(); | ||||
if (request.params.size() > 0 && request.params[0].isArray()) { | if (request.params[0].isArray()) { | ||||
EnableOrDisableLogCategories(request.params[0], true); | EnableOrDisableLogCategories(request.params[0], true); | ||||
} | } | ||||
if (request.params.size() > 1 && request.params[1].isArray()) { | if (request.params[1].isArray()) { | ||||
EnableOrDisableLogCategories(request.params[1], false); | EnableOrDisableLogCategories(request.params[1], false); | ||||
} | } | ||||
uint32_t updated_log_categories = GetLogger().GetCategoryMask(); | uint32_t updated_log_categories = GetLogger().GetCategoryMask(); | ||||
uint32_t changed_log_categories = | uint32_t changed_log_categories = | ||||
original_log_categories ^ updated_log_categories; | original_log_categories ^ updated_log_categories; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |