diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-02-12 23:28:56 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-02-12 23:28:56 +0200 |
commit | 6e7891506146d6cf026b48f1a7f355f5e677704b (patch) | |
tree | 16aba3c16a670f5bfb65dea4d1423d259f6cbd05 | |
parent | Merge pull request #1717 (diff) | |
parent | tools: log to the correct file (diff) | |
download | monero-6e7891506146d6cf026b48f1a7f355f5e677704b.tar.xz |
Merge pull request #1718
882db8e9 tools: log to the correct file (moneromooo-monero)
142e5e1e tools: set requested log level (moneromooo-monero)
-rw-r--r-- | src/blockchain_utilities/blockchain_export.cpp | 5 | ||||
-rw-r--r-- | src/blockchain_utilities/blockchain_import.cpp | 7 | ||||
-rw-r--r-- | src/blockchain_utilities/bootstrap_file.cpp | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp index b4411fbba..56f6d9485 100644 --- a/src/blockchain_utilities/blockchain_export.cpp +++ b/src/blockchain_utilities/blockchain_export.cpp @@ -57,6 +57,8 @@ std::string join_set_strings(const std::unordered_set<std::string>& db_types_all int main(int argc, char* argv[]) { + epee::string_tools::set_module_name_and_folder(argv[0]); + std::string default_db_type = "lmdb"; std::unordered_set<std::string> db_types_all = cryptonote::blockchain_db_types; @@ -125,7 +127,8 @@ int main(int argc, char* argv[]) log_level = command_line::get_arg(vm, arg_log_level); block_stop = command_line::get_arg(vm, arg_block_stop); - mlog_configure("monero-blockchain-export", true); + mlog_configure(mlog_get_default_log_path("monero-blockchain-export.log"), true); + mlog_set_log(std::string(std::to_string(log_level) + ",bcutil:INFO").c_str()); LOG_PRINT_L0("Starting..."); bool opt_testnet = command_line::get_arg(vm, arg_testnet_on); diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index 6f5520b59..d4fc93fb7 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -374,7 +374,7 @@ int import_from_file(FakeCore& simple_core, const std::string& import_file_path, return 2; } bytes_read += chunk_size; - MINFO("Total bytes read: " << bytes_read); + MDEBUG("Total bytes read: " << bytes_read); if (h + NUM_BLOCKS_PER_CHUNK < start_height + 1) { @@ -596,6 +596,8 @@ int import_from_file(FakeCore& simple_core, const std::string& import_file_path, int main(int argc, char* argv[]) { + epee::string_tools::set_module_name_and_folder(argv[0]); + std::string default_db_type = "lmdb"; std::string default_db_engine_compiled = "blockchain_db"; @@ -722,7 +724,8 @@ int main(int argc, char* argv[]) m_config_folder = command_line::get_arg(vm, data_dir_arg); db_arg_str = command_line::get_arg(vm, arg_database); - mlog_configure("monero-blockchain-import", true); + mlog_configure(mlog_get_default_log_path("monero-blockchain-import.log"), true); + mlog_set_log(std::string(std::to_string(log_level) + ",bcutil:INFO").c_str()); MINFO("Starting..."); boost::filesystem::path fs_import_file_path; diff --git a/src/blockchain_utilities/bootstrap_file.cpp b/src/blockchain_utilities/bootstrap_file.cpp index add2c65e6..94b474d4d 100644 --- a/src/blockchain_utilities/bootstrap_file.cpp +++ b/src/blockchain_utilities/bootstrap_file.cpp @@ -458,7 +458,7 @@ uint64_t BootstrapFile::count_blocks(const std::string& import_file_path) bytes_read += chunk_size; // std::cout << refresh_string; - MINFO("Number bytes scanned: " << bytes_read); + MDEBUG("Number bytes scanned: " << bytes_read); } import_file.close(); |