39 #include "boost/shared_ptr.hpp" 44 #include <QTextStream> 51 #include "QApplication" 56 class EventProcessingThread :
public QThread
70 qApp->processEvents();
77 mLogPath = this->getDefaultLogPath();
87 QString isoDateFormat(
"yyyy-MM-dd");
88 QString isoDate = QDateTime::currentDateTime().toString(isoDateFormat);
107 mThread.reset(
new EventProcessingThread());
108 mThread->setObjectName(
"org.custusx.resource.core.logger");
110 mWorker = this->createWorker();
111 mWorker->moveToThread(mThread.get());
112 if (!mLogPath.isEmpty())
113 mWorker->setLoggingFolder(mLogPath);
137 mLogPath = absoluteLoggingFolderPath;
139 mWorker->setLoggingFolder(mLogPath);
140 emit loggingFolderChanged();
151 mWorker->installObserver(observer, resend);
157 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.