diff --git a/fairmq/docs/Logging.md b/fairmq/docs/Logging.md index b76c91ba..fc1254f7 100644 --- a/fairmq/docs/Logging.md +++ b/fairmq/docs/Logging.md @@ -40,12 +40,12 @@ When running a FairMQ device, the log severity can be simply provided via `--sev ## 5.2 Log verbosity -The log severity is controlled via: +The log verbosity is controlled via: ```C++ fair::Logget::SetVerbosity(""); ``` -it is same for all sinks, and is one of the follwing values: `low`, `medium`, `high`, `veryhigh`, which translates to following output: +it is same for all sinks, and is one of the following values: `low`, `medium`, `high`, `veryhigh`, which translates to following output: ``` low: [severity] message @@ -63,6 +63,8 @@ Colored output on console can be activated with: Logger::SetConsoleColor(true); ``` +When running a FairMQ device, the log color (console) can be simply provided via `--color ` cmd option (default is true). + ## 5.4 File output Output to file can be enabled via: @@ -71,6 +73,8 @@ Logger::InitFileSink("", "test_log", true); ``` which will add output to "test_log" filename (if third parameter is `true` it will add timestamp to the file name) with `` severity. +When running a FairMQ device, the log file can be simply provided via `--log-to-file ` cmd option (this will also turn off console output). + ## 5.5 Custom sinks Custom sinks can be added via `Logger::AddCustomSink("sink name", "", callback)` method. diff --git a/fairmq/options/FairMQProgOptions.cxx b/fairmq/options/FairMQProgOptions.cxx index a0c0c1a4..29cf5deb 100644 --- a/fairmq/options/FairMQProgOptions.cxx +++ b/fairmq/options/FairMQProgOptions.cxx @@ -278,7 +278,6 @@ void FairMQProgOptions::InitOptionDescription() ("initialization-timeout", po::value()->default_value(120), "Timeout for the initialization in seconds (when expecting dynamic initialization).") ("port-range-min", po::value()->default_value(22000), "Start of the port range for dynamic initialization.") ("port-range-max", po::value()->default_value(32000), "End of the port range for dynamic initialization.") - ("log-to-file", po::value()->default_value(""), "Log output to a file.") ("print-channels", po::value()->implicit_value(true), "Print registered channel endpoints in a machine-readable format (::)") ("shm-segment-size", po::value()->default_value(2000000000), "Shared memory: size of the shared memory segment (in bytes).") ("rate", po::value()->default_value(0.), "Rate for conditional run loop (Hz).") diff --git a/fairmq/options/FairProgOptions.cxx b/fairmq/options/FairProgOptions.cxx index cf730df0..4bb6e8d3 100644 --- a/fairmq/options/FairProgOptions.cxx +++ b/fairmq/options/FairProgOptions.cxx @@ -30,9 +30,10 @@ FairProgOptions::FairProgOptions() fGeneralDesc.add_options() ("help,h", "produce help") ("version,v", "print version") - ("severity", po::value()->default_value("debug"), "Log severity level : trace, debug, info, state, warn, error, fatal, nolog") - ("verbosity", po::value()->default_value("medium"), "Log verbosity level : veryhigh, high, medium, low") + ("severity", po::value()->default_value("debug"), "Log severity level: trace, debug, info, state, warn, error, fatal, nolog") + ("verbosity", po::value()->default_value("medium"), "Log verbosity level: veryhigh, high, medium, low") ("color", po::value()->default_value(true), "Log color (true/false)") + ("log-to-file", po::value()->default_value(""), "Log output to a file.") ("print-options", po::value()->implicit_value(true), "print options in machine-readable format (