From 26bd7aac033792a280d115a841757fb215c66fcc Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 18 Feb 2017 20:44:23 +0000 Subject: wallet_api: fix logging init via api --- src/wallet/api/wallet.cpp | 5 +++++ src/wallet/api/wallet_manager.cpp | 1 - src/wallet/wallet2_api.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index c46de6b06..25463aa3c 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -258,6 +258,11 @@ uint64_t Wallet::maximumAllowedAmount() return std::numeric_limits::max(); } +void Wallet::init(const char *argv0, const char *default_log_base_name) { + epee::string_tools::set_module_name_and_folder(argv0); + mlog_configure(mlog_get_default_log_path(default_log_base_name), true); +} + void Wallet::debug(const std::string &str) { MDEBUG(str); } diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp index 4104e7884..733b2e487 100644 --- a/src/wallet/api/wallet_manager.cpp +++ b/src/wallet/api/wallet_manager.cpp @@ -451,7 +451,6 @@ WalletManager *WalletManagerFactory::getWalletManager() static WalletManagerImpl * g_walletManager = nullptr; if (!g_walletManager) { - mlog_configure("monero-wallet-gui.log", false); g_walletManager = new WalletManagerImpl(); } diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h index daa3deeee..edead807f 100644 --- a/src/wallet/wallet2_api.h +++ b/src/wallet/wallet2_api.h @@ -429,6 +429,7 @@ struct Wallet static std::string paymentIdFromAddress(const std::string &str, bool testnet); 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); /** -- cgit v1.2.3