| 201 | } |
| 202 | |
| 203 | static void EnableOrDisableLogCategories(UniValue cats, bool enable) { |
| 204 | cats = cats.get_array(); |
| 205 | for (unsigned int i = 0; i < cats.size(); ++i) { |
| 206 | std::string cat = cats[i].get_str(); |
| 207 | |
| 208 | bool success; |
| 209 | if (enable) { |
| 210 | success = LogInstance().EnableCategory(cat); |
| 211 | } else { |
| 212 | success = LogInstance().DisableCategory(cat); |
| 213 | } |
| 214 | |
| 215 | if (!success) { |
| 216 | throw JSONRPCError(RPC_INVALID_PARAMETER, "unknown logging category " + cat); |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | static RPCMethod logging() |
| 222 | { |
no test coverage detected