-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.cpp
More file actions
31 lines (23 loc) · 785 Bytes
/
logger.cpp
File metadata and controls
31 lines (23 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "logger.h"
#include <QTextBrowser>
//Logger* Logger::m_Instance = 0;
void Logger::debugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg){
static QTextBrowser* browser = new QTextBrowser();
browser->move(200,200);
browser->setWindowTitle("Debug-Fenster");
browser->show();
switch(type){
case QtDebugMsg:
browser->append(QString("Debug: %1").arg(msg));
break;
case QtWarningMsg:
browser->append(QString("Warning: %1").arg(msg));
break;
case QtCriticalMsg:
browser->append(QString("Critical: %1").arg(msg));
break;
case QtFatalMsg:
browser->append(QString("Fatal: %1").arg(msg));
break;
}
}