aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-24 19:08:02 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-24 19:08:02 +0000
commitcf2b1511163d8ba6641fef6af12da62a1db736cd (patch)
treeed1c08ea7f95eadd8c7eeb589da2660895cf2c9f /src
parentMerge pull request #1797 (diff)
downloadmonero-cf2b1511163d8ba6641fef6af12da62a1db736cd.tar.xz
wallet: avoid pre-log-init spew on --version
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet_args.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/wallet/wallet_args.cpp b/src/wallet/wallet_args.cpp
index db2042894..d2cda8700 100644
--- a/src/wallet/wallet_args.cpp
+++ b/src/wallet/wallet_args.cpp
@@ -106,10 +106,21 @@ namespace wallet_args
po::options_description desc_all;
desc_all.add(desc_general).add(desc_params);
po::variables_map vm;
+ std::string log_path;
bool r = command_line::handle_error_helper(desc_all, [&]()
{
po::store(command_line::parse_command_line(argc, argv, desc_general, true), vm);
+ if (command_line::has_arg(vm, arg_log_file))
+ log_path = command_line::get_arg(vm, arg_log_file);
+ else
+ log_path = mlog_get_default_log_path("monero-wallet-cli.log");
+ mlog_configure(log_path, log_to_console);
+ if (command_line::has_arg(vm, arg_log_level))
+ {
+ mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
+ }
+
if (command_line::get_arg(vm, command_line::arg_help))
{
tools::msg_writer() << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")";
@@ -134,17 +145,6 @@ namespace wallet_args
if(command_line::has_arg(vm, arg_max_concurrency))
tools::set_max_concurrency(command_line::get_arg(vm, arg_max_concurrency));
- std::string log_path;
- if (!vm["log-file"].defaulted())
- log_path = command_line::get_arg(vm, arg_log_file);
- else
- log_path = mlog_get_default_log_path("monero-wallet-cli.log");
- mlog_configure(log_path, log_to_console);
- if (!vm["log-level"].defaulted())
- {
- mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
- }
-
tools::scoped_message_writer(epee::console_color_white, true) << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")";
if (!vm["log-level"].defaulted())