diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-01-15 20:31:16 -0500 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-01-15 20:31:16 -0500 |
commit | ac7df193ca47261c2dfd91b230489e20955013a2 (patch) | |
tree | e4d312059948a0528583e7ea58d2c0b40307a494 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #1578 (diff) | |
parent | Change logging to easylogging++ (diff) | |
download | monero-ac7df193ca47261c2dfd91b230489e20955013a2.tar.xz |
Merge pull request #1522
5833d66f Change logging to easylogging++ (moneromooo-monero)
dc98019b easylogging++: fix logging with static const header only data members (moneromooo-monero)
3b46617b easylogging++: add ELPP_DISABLE_CHECK_MACROS (moneromooo-monero)
6fe39d90 easylogging++: allow clipping a common filename prefix (moneromooo-monero)
43abf6ff easylogging++: add file-only logs (moneromooo-monero)
c313bea4 eayslogging++: Fix bad memory access before opening any files (moneromooo-monero)
0af5d168 easylogging++: avoid creating directory/filename for the builtin default log file (moneromooo-monero)
28362847 easylogging++: allow setting thread names (moneromooo-monero)
ec71ce8d easylogging++: Print thread ID in a nicer way (moneromooo-monero)
2a0bf783 easylogging++: Add logging categories (moneromooo-monero)
c50bbbfe easylogging++: import upstream (moneromooo-monero)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 0cec3c26e..29c61eca2 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -678,17 +678,20 @@ namespace cryptonote //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::on_set_log_level(const COMMAND_RPC_SET_LOG_LEVEL::request& req, COMMAND_RPC_SET_LOG_LEVEL::response& res) { - if (req.level < LOG_LEVEL_MIN || req.level > LOG_LEVEL_MAX) + if (req.level < 0 || req.level > 4) { res.status = "Error: log level not valid"; + return true; } - else - { - epee::log_space::log_singletone::get_set_log_detalisation_level(true, req.level); - int otshell_utils_log_level = 100 - (req.level * 20); - gCurrentLogger.setDebugLevel(otshell_utils_log_level); - res.status = CORE_RPC_STATUS_OK; - } + mlog_set_log_level(req.level); + res.status = CORE_RPC_STATUS_OK; + return true; + } + //------------------------------------------------------------------------------------------------------------------------------ + bool core_rpc_server::on_set_log_categories(const COMMAND_RPC_SET_LOG_CATEGORIES::request& req, COMMAND_RPC_SET_LOG_CATEGORIES::response& res) + { + mlog_set_categories(req.categories.c_str()); + res.status = CORE_RPC_STATUS_OK; return true; } //------------------------------------------------------------------------------------------------------------------------------ |