| 619 | } |
| 620 | |
| 621 | static void EnableOrDisableLogCategories(UniValue cats, bool enable) { |
| 622 | cats = cats.get_array(); |
| 623 | for (unsigned int i = 0; i < cats.size(); ++i) { |
| 624 | std::string cat = cats[i].get_str(); |
| 625 | |
| 626 | bool success; |
| 627 | if (enable) { |
| 628 | success = LogInstance().EnableCategory(cat); |
| 629 | } else { |
| 630 | success = LogInstance().DisableCategory(cat); |
| 631 | } |
| 632 | |
| 633 | if (!success) { |
| 634 | throw JSONRPCError(RPC_INVALID_PARAMETER, "unknown logging category " + cat); |
| 635 | } |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | static RPCHelpMan logging() |
| 640 | { |
no test coverage detected