Yearly bump
[quassel.git] / src / common / logger.cpp
index 78a3610..ab9b352 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2012 by the Quassel Project                        *
+ *   Copyright (C) 2005-2013 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -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;
+  }
 }