17 #include "boost/bind.hpp" 18 #include "boost/shared_ptr.hpp" 23 #include <QTextStream> 41 qRegisterMetaType<Message>(
"Message");
55 qInstallMessageHandler(0);
60 bool ReporterThread::initializeLogFile(
LogFile file)
63 if (mInitializedFiles.contains(filename))
66 mInitializedFiles << filename;
81 mLogPath = absoluteLoggingFolderPath;
83 QFileInfo(mLogPath+
"/").absoluteDir().mkpath(
".");
96 this->sendToCout(msg);
98 QMetaObject::invokeMethod(
this,
"processMessage",
103 void ReporterThread::onMessageEmitted(
Message msg)
106 this->sendToFile(msg);
109 void ReporterThread::sendToFile(
Message message)
118 this->initializeLogFile(channelLog);
120 channelLog.
write(message);
121 allLog.
write(message);
124 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 write(Message message)
void emittedMessage(Message message)
emitted for each new message, in addition to writing to observer.
void silenceQtMessages(QtMsgType type, const QMessageLogContext &, const QString &msg)
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.
Namespace for all CustusX production code.