summaryrefslogtreecommitdiff
path: root/src/logbuffer.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-01-04 15:57:14 +0100
committerTannin <devnull@localhost>2014-01-04 15:57:14 +0100
commit4dc3538a7d14dd0f1aaa2e6c172745b63e251c86 (patch)
tree2242c92482306c5710b00dfb212cce11456e776d /src/logbuffer.cpp
parent14ac234daf1680b0685f6bea3e74aa09dfcf38ef (diff)
- nxmhandler will now ask before registering itself
- downloads from nexus are now displayed before file information is retrieved - logging from the ui is now a bit more informative - download list now scrolls to bottom automatically
Diffstat (limited to 'src/logbuffer.cpp')
-rw-r--r--src/logbuffer.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/logbuffer.cpp b/src/logbuffer.cpp
index a3b6f1b5..f930cf10 100644
--- a/src/logbuffer.cpp
+++ b/src/logbuffer.cpp
@@ -112,13 +112,26 @@ void LogBuffer::log(QtMsgType type, const QMessageLogContext &context, const QSt
#else
+
+char LogBuffer::msgTypeID(QtMsgType type)
+{
+ switch (type) {
+ case QtDebugMsg: return 'D';
+ case QtWarningMsg: return 'W';
+ case QtCriticalMsg: return 'C';
+ case QtFatalMsg: return 'F';
+ }
+}
+
+#include <QDateTime>
+
void LogBuffer::log(QtMsgType type, const char *message)
{
QMutexLocker guard(&s_Mutex);
if (!s_Instance.isNull()) {
s_Instance->logMessage(type, message);
}
- fprintf(stdout, "%s\n", message);
+ fprintf(stdout, "[%c] %s: %s\n", msgTypeID(type), qPrintable(QTime::currentTime().toString()), message);
fflush(stdout);
}