X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Flogger.cpp;h=27a3f6d7a976357b4993f4046a52be97f26f879a;hp=5eb318f16a1672d89394d9cb66b60740bbfe1a08;hb=a20c9bf454288c998cb2a5d2a1fdf0927c93f1f3;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/common/logger.cpp b/src/common/logger.cpp index 5eb318f1..27a3f6d7 100644 --- a/src/common/logger.cpp +++ b/src/common/logger.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 by the Quassel Project * + * Copyright (C) 2005-2014 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include @@ -77,7 +77,7 @@ void Logger::log() prio = LOG_INFO; break; } - syslog(LOG_USER & prio, "%s", qPrintable(_buffer)); + syslog(prio|LOG_USER, "%s", qPrintable(_buffer)); } #endif @@ -97,6 +97,7 @@ void Logger::log() } +#if QT_VERSION < 0x050000 void Logger::logMessage(QtMsgType type, const char *msg) { switch (type) { @@ -115,3 +116,25 @@ void Logger::logMessage(QtMsgType type, const char *msg) return; } } +#else +void Logger::logMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg) +{ + Q_UNUSED(context) + + switch (type) { + case QtDebugMsg: + Logger(Quassel::DebugLevel) << msg.toLocal8Bit().constData(); + break; + case QtWarningMsg: + Logger(Quassel::WarningLevel) << msg.toLocal8Bit().constData(); + break; + case QtCriticalMsg: + Logger(Quassel::ErrorLevel) << msg.toLocal8Bit().constData(); + break; + case QtFatalMsg: + Logger(Quassel::ErrorLevel) << msg.toLocal8Bit().constData(); + Quassel::logFatalMessage(msg.toLocal8Bit().constData()); + return; + } +} +#endif