Skip to content

Commit

Permalink
Add --log-none command line option to disable ALL output from a logdo…
Browse files Browse the repository at this point in the history
…main
  • Loading branch information
CelticMinstrel committed Feb 21, 2018
1 parent 83339dc commit 212e089
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/man/wesnoth.6
Expand Up @@ -131,10 +131,12 @@ Example:
sets the severity level of the log domains.
.B all
can be used to match any log domain. Available levels:
.BR error ,\ warning ,\ info ,\ debug .
.BR error ,\ warning ,\ info ,\ debug ,\ none .
By default the
.B error
level is used.
level is used for most domains, but
.B deprecation
defaults to none.
.TP
.B --log-precise
shows the timestamps in the logfile with more precision.
Expand Down
3 changes: 3 additions & 0 deletions src/commandline_options.cpp
Expand Up @@ -227,6 +227,7 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
("log-warning", po::value<std::string>(), "sets the severity level of the specified log domain(s) to 'warning'. Similar to --log-error.")
("log-info", po::value<std::string>(), "sets the severity level of the specified log domain(s) to 'info'. Similar to --log-error.")
("log-debug", po::value<std::string>(), "sets the severity level of the specified log domain(s) to 'debug'. Similar to --log-error.")
("log-none", po::value<std::string>(), "sets the severity level of the specified log domain(s) to 'none'. Similar to --log-error.")
("log-precise", "shows the timestamps in the logfile with more precision.")
;

Expand Down Expand Up @@ -362,6 +363,8 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
parse_log_domains_(vm["log-info"].as<std::string>(),lg::info().get_severity());
if (vm.count("log-debug"))
parse_log_domains_(vm["log-debug"].as<std::string>(),lg::debug().get_severity());
if (vm.count("log-none"))
parse_log_domains_(vm["log-none"].as<std::string>(),-1);
if (vm.count("logdomains"))
logdomains = vm["logdomains"].as<std::string>();
if (vm.count("log-precise"))
Expand Down

0 comments on commit 212e089

Please sign in to comment.