17 #include "boost/bind.hpp" 18 #include "boost/shared_ptr.hpp" 23 #include <QTextStream> 43 qRegisterMetaType<Message>(
"Message");
57 qInstallMessageHandler(0);
62 bool ReporterThread::initializeLogFile(
LogFile file)
65 if (mInitializedFiles.contains(filename))
68 mInitializedFiles << filename;
83 mLogPath = absoluteLoggingFolderPath;
85 QFileInfo(mLogPath+
"/").absoluteDir().mkpath(
".");
98 this->sendToCout(msg);
100 QMetaObject::invokeMethod(
this,
"processMessage",
101 Qt::QueuedConnection,
105 void ReporterThread::onMessageEmitted(
Message msg)
108 this->sendToFile(msg);
111 void ReporterThread::sendToFile(
Message message)
120 this->initializeLogFile(channelLog);
122 channelLog.
write(message);
123 allLog.
write(message);
126 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.
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.