From: Marcus Eggenberger Date: Mon, 3 Nov 2008 19:17:30 +0000 (+0100) Subject: debug output in the client is also written to stderr now X-Git-Tag: 0.3.1~81 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=d5e2af28c7680ebe5ff68390018f81114675d395 debug output in the client is also written to stderr now --- diff --git a/src/client/client.cpp b/src/client/client.cpp index ca008e90..777b3607 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -406,23 +406,14 @@ void Client::bufferRenamed(BufferId bufferId, const QString &newName) { } void Client::logMessage(QtMsgType type, const char *msg) { - QString prefix; - switch (type) { - case QtDebugMsg: - prefix = "Debug"; - break; - case QtWarningMsg: - prefix = "Warning"; - break; - case QtCriticalMsg: - prefix = "Critical"; - break; - case QtFatalMsg: + if(type == QtFatalMsg) { Quassel::logFatalMessage(msg); - return; + } else { + fprintf(stderr, "%s\n", msg); + fflush(stderr); + QString msgString = QString("%1\n").arg(msg); + instance()->_debugLog << msgString; + emit instance()->logUpdated(msgString); } - QString msgString = QString("%1: %3\n").arg(prefix, msg); - instance()->_debugLog << msgString; - emit instance()->logUpdated(msgString); }