18 #include "boost/shared_ptr.hpp" 23 #include <QTextStream> 29 #include "QApplication" 34 class EventProcessingThread :
public QThread
48 qApp->processEvents();
55 mLogPath = this->getDefaultLogPath();
65 QString isoDateFormat(
"yyyy-MM-dd");
66 QString isoDate = QDateTime::currentDateTime().toString(isoDateFormat);
85 mThread.reset(
new EventProcessingThread());
86 mThread->setObjectName(
"org.custusx.resource.core.logger");
88 mWorker = this->createWorker();
89 mWorker->moveToThread(mThread.get());
90 if (!mLogPath.isEmpty())
91 mWorker->setLoggingFolder(mLogPath);
115 mLogPath = absoluteLoggingFolderPath;
117 mWorker->setLoggingFolder(mLogPath);
118 emit loggingFolderChanged();
129 mWorker->installObserver(observer, resend);
135 mWorker->uninstallObserver(observer);
virtual ~EventProcessingThread()
virtual void onEmittedMessage(Message message)
void setLoggingFolder(QString absoluteLoggingFolderPath)
QString getDefaultLogPath() const
static ProfileManager * getInstance(QString defaultProfile=QString("Laboratory"))
returns the only instance of this class
void installObserver(MessageObserverPtr observer, bool resend)
QString getLoggingFolder() const
void emittedMessage(Message message)
emitted for each new message, in addition to writing to observer.
boost::shared_ptr< class MessageObserver > MessageObserverPtr
boost::shared_ptr< class LogThread > LogThreadPtr
QString getSettingsPath()
void uninstallObserver(MessageObserverPtr observer)
Namespace for all CustusX production code.