Workspace 6.21.5
|
Implementation of the LogManager that supports logging from mulitiple threads simultaneously. More...
#include <Workspace/Application/logmanagerimplthreaded.h>
Inherits LogManagerImpl.
Public Types | |
using | FilterRegistry = QMap< const QThread *, FilterSet > |
using | FilterSet = QSet< DataExecution::LogStreamFilter > |
Public Member Functions | |
LogManagerImplThreaded () | |
~LogManagerImplThreaded () | |
bool | addMessageCategory (const LogManager::MessageCategory &category) override |
void | addStream (DataExecution::LogStream &logStream) override |
void | cleanup () override |
bool | filterMessage (const QString &msg, const QString &category, const QThread *currThread, const QThread *parentThread) override |
void | flush () override |
void | flushAsync () override |
const LogManager::MessageCategory * | getMessageCategory (const QString &category) const override |
QList< const DataExecution::LogStream * > | getStreams () const override |
bool | hasMessageCategory (const QString &category) const override |
bool | installFilter (const DataExecution::LogStreamFilter &filter) override |
bool | isMessageCategoryEnabled (const QString &category) const override |
void | logText (const QString &msg, const QString &category) override |
void | logTextAsync (const QString &msg, const QString &category) override |
bool | removeFilter (const DataExecution::LogStreamFilter &filter) override |
bool | removeStream (DataExecution::LogStream &logStream) override |
void | setDefaultMessageCategory (const QString &category) override |
void | setMessageCategoryEnabled (const QString &category, bool enabled) override |
Public Attributes | |
std::mutex | filterAddRemoveMutex_ |
FilterRegistry | filters_ |
std::atomic_bool | haveFilters_ {false} |
This is the implementation of the LogManager that will be used if being used in a QCoreApplication. It uses a threadsafe queue to manage all requests for updates to the log, including messages or addition / removal of log streams.
using FilterRegistry = QMap<const QThread*, FilterSet> |
using FilterSet = QSet<DataExecution::LogStreamFilter> |
|
default |
|
override |
|
override |
|
override |
|
override |
|
override |
Flush the log (synchronously).
|
override |
Flush the log (asynchronously).
|
override |
categoryName | The name of the category to retrieve. |
|
override |
Retrieves all streams
|
override |
category | The category we are testing. |
Checks whether the log manager has knowledge of a specific category.
|
override |
filter | The filter to install |
Installs a message filter.
|
override |
category | The category to check |
|
override |
Synchronous version of the logText function.
|
override |
Asynchronous version of the logText function.
|
override |
|
override |
Removes a stream (synchronously).
|
override |
category | The message category to set as a default. By default, this is not used, so all messages will be logged with no category. |
|
override |
category | The category to enable / disable |
enabled | The desired enabled state of the category |
Enables / disables a specific category name in the LogManager. The LogManager uses categories with the LogText call to "tag" specific text with a certain category. By disabling category, log messages associated with that category will not be displayed.
std::mutex filterAddRemoveMutex_ |
FilterRegistry filters_ |
std::atomic_bool haveFilters_ {false} |