35 #include "boost/bind.hpp"
67 QMutexLocker sentry(&mActionsMutex);
68 mPendingActions.push_back(action);
71 this->invokePendingAction();
74 void LogThread::invokePendingAction()
76 QMetaObject::invokeMethod(
this,
"pendingAction", Qt::QueuedConnection);
81 while (this->executeAction());
84 bool LogThread::executeAction()
86 PendingActionType action = this->popAction();
94 LogThread::PendingActionType LogThread::popAction()
96 QMutexLocker sentry(&mActionsMutex);
97 PendingActionType action;
99 if (mPendingActions.isEmpty())
102 action = mPendingActions.front();
103 mPendingActions.pop_front();
134 int LogThread::getDefaultTimeout(MESSAGE_LEVEL messageLevel)
const
void callInLogThread(PendingActionType &action)
virtual void installObserver(MessageObserverPtr observer, bool resend)
void uninstall(MessageObserverPtr observer)
virtual void uninstallObserver(MessageObserverPtr observer)
static MessageRepositoryPtr create()
virtual void setLoggingFolder(QString absoluteLoggingFolderPath)
call during startup, will fail if called when running
LogThread(QObject *parent=NULL)
MESSAGE_LEVEL mMessageLevel
MessageRepositoryPtr mRepository
virtual void executeSetLoggingFolder(QString absoluteLoggingFolderPath)=0
void emittedMessage(Message message)
emitted for each new message, in addition to writing to observer.
void install(MessageObserverPtr observer, bool resend)
boost::shared_ptr< class MessageObserver > MessageObserverPtr
void processMessage(Message msg)
Message cleanupMessage(Message message)