From: Kevin Ottens Date: Mon, 5 Oct 2020 17:34:46 +0000 (+0200) Subject: Make sure --logfile has precedence on config X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~121^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=167800320ff0fbeda001f3a355e6d0896fabb5ca;p=nextcloud-desktop.git Make sure --logfile has precedence on config Since we changed the default in the config file and since log dir had precedence on log file, the --logfile command line option wasn't doing anything anymore. We make sure it has an effect again overriding --logdir or the logDir config entry. Signed-off-by: Kevin Ottens --- diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 9ac569cbc..a408b392b 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -408,7 +408,9 @@ void Application::setupLogging() // might be called from second instance auto logger = Logger::instance(); logger->setLogFile(_logFile); - logger->setLogDir(!_logDir.isEmpty() ? _logDir : ConfigFile().logDir()); + if (_logFile.isEmpty()) { + logger->setLogDir(_logDir.isEmpty() ? ConfigFile().logDir() : _logDir); + } logger->setLogExpire(_logExpire > 0 ? _logExpire : ConfigFile().logExpire()); logger->setLogFlush(_logFlush || ConfigFile().logFlush()); logger->setLogDebug(_logDebug || ConfigFile().logDebug());