X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Flogger.cpp;h=bf270f9dbe356e487699bc3466368f7884d823d0;hp=78a3610c82b2116f331f1c29e79e824e9fd1c9e3;hb=2b1fcb466b3694a900aab579d60d8e61456844f7;hpb=a4251618e99c35f727c526f8480055d5a9c5e41f diff --git a/src/common/logger.cpp b/src/common/logger.cpp index 78a3610c..bf270f9d 100644 --- a/src/common/logger.cpp +++ b/src/common/logger.cpp @@ -76,22 +76,21 @@ void Logger::log() { } syslog(LOG_USER & prio, "%s", qPrintable(_buffer)); } - // don't log to stdout if --syslog was specified (but neither ignore --logfile) - if(!Quassel::logFile()) - return; #endif - _buffer.prepend(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss ")); + // if we neither use syslog nor have a logfile we log to stdout - // if we don't have a logfile we log to stdout + if(Quassel::logFile() || !Quassel::logToSyslog()) { + _buffer.prepend(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss ")); - QTextStream out(stdout); - if(Quassel::logFile() && Quassel::logFile()->isOpen()) { - _buffer.remove(QChar('\n')); - out.setDevice(Quassel::logFile()); - } + QTextStream out(stdout); + if(Quassel::logFile() && Quassel::logFile()->isOpen()) { + _buffer.remove(QChar('\n')); + out.setDevice(Quassel::logFile()); + } - out << _buffer << endl; + out << _buffer << endl; + } }