aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-05 19:45:00 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-05 19:45:00 +0000
commit5fee85616d408dd2e30c3aa104c4c24566a6f480 (patch)
tree7c07938c67efd3f5585063cff935b8650fe72fb0
parentblockchain_import: error out nicely on exceptions (diff)
downloadmonero-5fee85616d408dd2e30c3aa104c4c24566a6f480.tar.xz
blockchain_export: make --log-level understand categories
-rw-r--r--src/blockchain_utilities/blockchain_export.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp
index b45f36771..f145bc107 100644
--- a/src/blockchain_utilities/blockchain_export.cpp
+++ b/src/blockchain_utilities/blockchain_export.cpp
@@ -82,7 +82,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_output_file = {"output-file", "Specify output 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<bool> arg_testnet_on = {
"testnet"
@@ -126,11 +126,13 @@ int main(int argc, char* argv[])
return 1;
}
- log_level = command_line::get_arg(vm, arg_log_level);
+ mlog_configure(mlog_get_default_log_path("monero-blockchain-export.log"), true);
+ 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());
block_stop = command_line::get_arg(vm, arg_block_stop);
- 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);