38 #include "boost/bind.hpp"
39 #include "boost/shared_ptr.hpp"
44 #include <QTextStream>
64 qRegisterMetaType<Message>(
"Message");
78 qInstallMessageHandler(0);
83 bool ReporterThread::initializeLogFile(
LogFile file)
86 if (mInitializedFiles.contains(filename))
89 mInitializedFiles << filename;
104 mLogPath = absoluteLoggingFolderPath;
106 QFileInfo(mLogPath+
"/").absoluteDir().mkpath(
".");
119 this->sendToCout(msg);
121 QMetaObject::invokeMethod(
this,
"processMessage",
122 Qt::QueuedConnection,
126 void ReporterThread::onMessageEmitted(
Message msg)
129 this->sendToFile(msg);
132 void ReporterThread::sendToFile(
Message message)
141 this->initializeLogFile(channelLog);
143 channelLog.write(message);
144 allLog.write(message);
147 void ReporterThread::sendToCout(
Message message)
QString getPrintableMessage() const
Text containing information appropriate to display.
virtual void logMessage(Message msg)
virtual void executeSetLoggingFolder(QString absoluteLoggingFolderPath)
void emittedMessage(Message message)
emitted for each new message, in addition to writing to observer.
static LogFile fromChannel(QString path, QString channel)
QString getFilename() const
void convertQtMessagesToCxMessages(QtMsgType type, const QMessageLogContext &, const QString &msg)
virtual ~ReporterThread()
void processMessage(Message msg)
ReporterThread(QObject *parent=NULL)
MESSAGE_LEVEL getMessageLevel() const
The category of the message.