|
|
@ -7,6 +7,7 @@ |
|
|
|
#include "clientversion.h" |
|
|
|
#include "clientversion.h" |
|
|
|
#include "init.h" |
|
|
|
#include "init.h" |
|
|
|
#include "validation.h" |
|
|
|
#include "validation.h" |
|
|
|
|
|
|
|
#include "httpserver.h" |
|
|
|
#include "net.h" |
|
|
|
#include "net.h" |
|
|
|
#include "netbase.h" |
|
|
|
#include "netbase.h" |
|
|
|
#include "rpc/blockchain.h" |
|
|
|
#include "rpc/blockchain.h" |
|
|
@ -598,6 +599,20 @@ UniValue logging(const JSONRPCRequest& request) |
|
|
|
logCategories &= ~getCategoryMask(request.params[1]); |
|
|
|
logCategories &= ~getCategoryMask(request.params[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update libevent logging if BCLog::LIBEVENT has changed.
|
|
|
|
|
|
|
|
// If the library version doesn't allow it, UpdateHTTPServerLogging() returns false,
|
|
|
|
|
|
|
|
// in which case we should clear the BCLog::LIBEVENT flag.
|
|
|
|
|
|
|
|
// Throw an error if the user has explicitly asked to change only the libevent
|
|
|
|
|
|
|
|
// flag and it failed.
|
|
|
|
|
|
|
|
uint32_t changedLogCategories = originalLogCategories ^ logCategories; |
|
|
|
|
|
|
|
if (changedLogCategories & BCLog::LIBEVENT) { |
|
|
|
|
|
|
|
if (!UpdateHTTPServerLogging(logCategories & BCLog::LIBEVENT)) { |
|
|
|
|
|
|
|
logCategories &= ~BCLog::LIBEVENT; |
|
|
|
|
|
|
|
if (changedLogCategories == BCLog::LIBEVENT) { |
|
|
|
|
|
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "libevent logging cannot be updated when using libevent before v2.1.1."); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UniValue result(UniValue::VOBJ); |
|
|
|
UniValue result(UniValue::VOBJ); |
|
|
|
std::vector<CLogCategoryActive> vLogCatActive = ListActiveLogCategories(); |
|
|
|
std::vector<CLogCategoryActive> vLogCatActive = ListActiveLogCategories(); |
|
|
|