aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-05 19:45:22 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-05 19:45:22 +0000
commit38359036503d7159e7993d9f94c7d1e9afa62d02 (patch)
treebb03118bdfe1f2c552e57150e3cd27c026becf46
parentblockchain_export: make --log-level understand categories (diff)
downloadmonero-38359036503d7159e7993d9f94c7d1e9afa62d02.tar.xz
blockchain_import: make --log-level understand categories
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp
index 66dd0b136..b2c217ca1 100644
--- a/src/blockchain_utilities/blockchain_import.cpp
+++ b/src/blockchain_utilities/blockchain_import.cpp
@@ -624,7 +624,7 @@ int main(int argc, char* argv[])
po::options_description desc_cmd_only("Command line options");
po::options_description desc_cmd_sett("Command line options and settings options");
const command_line::arg_descriptor<std::string> arg_input_file = {"input-file", "Specify input file", "", true};
- const command_line::arg_descriptor<uint32_t> arg_log_level = {"log-level", "", log_level};
+ const command_line::arg_descriptor<std::string> arg_log_level = {"log-level", "0-4 or categories", ""};
const command_line::arg_descriptor<uint64_t> arg_block_stop = {"block-stop", "Stop at block number", block_stop};
const command_line::arg_descriptor<uint64_t> arg_batch_size = {"batch-size", "", db_batch_size};
const command_line::arg_descriptor<uint64_t> arg_pop_blocks = {"pop-blocks", "Remove blocks from end of blockchain", num_blocks};
@@ -684,7 +684,6 @@ int main(int argc, char* argv[])
if (! r)
return 1;
- log_level = command_line::get_arg(vm, arg_log_level);
opt_verify = command_line::get_arg(vm, arg_verify);
opt_batch = command_line::get_arg(vm, arg_batch);
opt_resume = command_line::get_arg(vm, arg_resume);
@@ -727,7 +726,11 @@ int main(int argc, char* argv[])
db_arg_str = command_line::get_arg(vm, arg_database);
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());
+ if (!vm["log-level"].defaulted())
+ mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
+ else
+ mlog_set_log(std::string(std::to_string(log_level) + ",bcutil:INFO").c_str());
+
MINFO("Starting...");
boost::filesystem::path fs_import_file_path;