From e0cda74ace17a910c50234f8db7e289c86274d6b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 4 Mar 2018 17:04:18 +0000 Subject: wallet2_api: add info/error/warning entry points --- src/wallet/api/wallet.cpp | 16 ++++++++++++++-- src/wallet/api/wallet2_api.h | 5 ++++- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 5ce8ede8d..9054f552a 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -295,8 +295,20 @@ void Wallet::init(const char *argv0, const char *default_log_base_name) { mlog_configure(mlog_get_default_log_path(default_log_base_name), true); } -void Wallet::debug(const std::string &str) { - MDEBUG(str); +void Wallet::debug(const std::string &category, const std::string &str) { + MCDEBUG(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); +} + +void Wallet::info(const std::string &category, const std::string &str) { + MCINFO(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); +} + +void Wallet::warning(const std::string &category, const std::string &str) { + MCWARNING(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); +} + +void Wallet::error(const std::string &category, const std::string &str) { + MCERROR(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); } ///////////////////////// WalletImpl implementation //////////////////////// diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h index a22788399..fcb44de3e 100644 --- a/src/wallet/api/wallet2_api.h +++ b/src/wallet/api/wallet2_api.h @@ -535,7 +535,10 @@ struct Wallet static uint64_t maximumAllowedAmount(); // Easylogger wrapper static void init(const char *argv0, const char *default_log_base_name); - static void debug(const std::string &str); + static void debug(const std::string &category, const std::string &str); + static void info(const std::string &category, const std::string &str); + static void warning(const std::string &category, const std::string &str); + static void error(const std::string &category, const std::string &str); /** * @brief StartRefresh - Start/resume refresh thread (refresh every 10 seconds) -- cgit v1.2.3