From 4105b70f74e31251ce0eaa92970f64820ec240ed Mon Sep 17 00:00:00 2001 From: Edward d'Auvergne Date: Thu, 7 Nov 2019 14:50:25 +0100 Subject: [PATCH] Options: Only set the logging priority if the command line option is supplied. This prevents the changing of the logstream priority as set by the test suite permanently to "alert" during the execution of tests. Setting a default value of SG_ALERT is not required as this is the simgear logstream default anyway. --- src/Main/options.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 20674f2b9..147659aca 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -2115,7 +2115,10 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath) // establish log-level before anything else - otherwise it is not possible // to show extra (debug/info/warning) messages for the start-up phase. - fgOptLogLevel(valueForOption("log-level", "alert").c_str()); + // Leave the simgear logstream default value of SG_ALERT if the argument is + // not supplied. + if (isOptionSet("log-level")) + fgOptLogLevel(valueForOption("log-level").c_str()); simgear::PathList::const_iterator i; for (i = p->configFiles.begin(); i != p->configFiles.end(); ++i) {