From 6bed9dcea2c3d67b2bb9d668b96ad3882585399f Mon Sep 17 00:00:00 2001 From: Alexandr Dzhurinskij Date: Wed, 9 Nov 2016 18:45:56 +0300 Subject: [PATCH] Add custom path to log file --- src/fastnetmon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fastnetmon.cpp b/src/fastnetmon.cpp index d8efc01..eba4a83 100644 --- a/src/fastnetmon.cpp +++ b/src/fastnetmon.cpp @@ -2582,6 +2582,7 @@ int main(int argc, char** argv) { ("version", "show version") ("daemonize", "detach from the terminal") ("configuration_file", po::value(), "set path to custom configuration file") + ("log_file", po::value(), "set path to custom log file") ; po::variables_map vm; @@ -2606,6 +2607,11 @@ int main(int argc, char** argv) { global_config_path = vm["configuration_file"].as(); std::cout << "We will use custom path to configuration file: " << global_config_path << std::endl; } + + if (vm.count("log_file")) { + log_file_path = vm["log_file"].as(); + std::cout << "We will use custom path to log file: " << log_file_path << std::endl; + } } catch (po::error& e) { std::cerr << "ERROR: " << e.what() << std::endl << std::endl; exit(EXIT_FAILURE);