aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-09-25 16:54:08 +0200
committerRiccardo Spagni <ric@spagni.net>2017-09-25 16:54:08 +0200
commit32bbe62120cf458a265722f47bd5b6c830530b08 (patch)
tree4d325b3d7623a538fb4dcdbf6dced5073b0c17fb /src
parentMerge pull request #2452 (diff)
parentdaemon, wallet: add --max-log-file-size option (diff)
downloadmonero-32bbe62120cf458a265722f47bd5b6c830530b08.tar.xz
Merge pull request #2456
91def9a5 daemon, wallet: add --max-log-file-size option (selsta)
Diffstat (limited to 'src')
-rw-r--r--src/daemon/command_line_args.h5
-rw-r--r--src/daemon/main.cpp3
-rw-r--r--src/wallet/wallet_args.cpp4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h
index f19d5cc63..7fa58f9d8 100644
--- a/src/daemon/command_line_args.h
+++ b/src/daemon/command_line_args.h
@@ -46,6 +46,11 @@ namespace daemon_args
, "Specify log file"
, ""
};
+ const command_line::arg_descriptor<std::size_t> arg_max_log_file_size = {
+ "max-log-file-size"
+ , "Specify maximum log file size [B]"
+ , MAX_LOG_FILE_SIZE
+ };
const command_line::arg_descriptor<std::string> arg_log_level = {
"log-level"
, ""
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp
index 8f6d542b6..acc23b9f9 100644
--- a/src/daemon/main.cpp
+++ b/src/daemon/main.cpp
@@ -88,6 +88,7 @@ int main(int argc, char const * argv[])
bf::path default_log = default_data_dir / std::string(CRYPTONOTE_NAME ".log");
command_line::add_arg(core_settings, daemon_args::arg_log_file, default_log.string());
command_line::add_arg(core_settings, daemon_args::arg_log_level);
+ command_line::add_arg(core_settings, daemon_args::arg_max_log_file_size);
command_line::add_arg(core_settings, daemon_args::arg_max_concurrency);
command_line::add_arg(core_settings, daemon_args::arg_zmq_rpc_bind_ip);
command_line::add_arg(core_settings, daemon_args::arg_zmq_rpc_bind_port);
@@ -207,7 +208,7 @@ int main(int argc, char const * argv[])
if (! vm["log-file"].defaulted())
log_file_path = command_line::get_arg(vm, daemon_args::arg_log_file);
log_file_path = bf::absolute(log_file_path, relative_path_base);
- mlog_configure(log_file_path.string(), true);
+ mlog_configure(log_file_path.string(), true, command_line::get_arg(vm, daemon_args::arg_max_log_file_size));
// Set log level
if (!vm["log-level"].defaulted())
diff --git a/src/wallet/wallet_args.cpp b/src/wallet/wallet_args.cpp
index 42651c32d..22cfcc269 100644
--- a/src/wallet/wallet_args.cpp
+++ b/src/wallet/wallet_args.cpp
@@ -84,6 +84,7 @@ namespace wallet_args
#endif
const command_line::arg_descriptor<std::string> arg_log_level = {"log-level", "0-4 or categories", ""};
+ const command_line::arg_descriptor<std::size_t> arg_max_log_file_size = {"max-log-file-size", "Specify maximum log file size [B]", MAX_LOG_FILE_SIZE};
const command_line::arg_descriptor<uint32_t> arg_max_concurrency = {"max-concurrency", wallet_args::tr("Max number of threads to use for a parallel job"), DEFAULT_MAX_CONCURRENCY};
const command_line::arg_descriptor<std::string> arg_log_file = {"log-file", wallet_args::tr("Specify log file"), ""};
const command_line::arg_descriptor<std::string> arg_config_file = {"config-file", wallet_args::tr("Config file"), "", true};
@@ -101,6 +102,7 @@ namespace wallet_args
command_line::add_arg(desc_params, arg_log_file);
command_line::add_arg(desc_params, arg_log_level);
+ command_line::add_arg(desc_params, arg_max_log_file_size);
command_line::add_arg(desc_params, arg_max_concurrency);
command_line::add_arg(desc_params, arg_config_file);
@@ -156,7 +158,7 @@ namespace wallet_args
log_path = command_line::get_arg(vm, arg_log_file);
else
log_path = mlog_get_default_log_path(default_log_name);
- mlog_configure(log_path, log_to_console);
+ mlog_configure(log_path, log_to_console, command_line::get_arg(vm, arg_max_log_file_size));
if (!vm["log-level"].defaulted())
{
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());