Workspace 6.21.5
Public Types | Public Member Functions | Public Attributes | List of all members
LogManagerImplUnthreaded Class Reference

Implementation of the LogManager that supports logging from a single thread only. More...

#include <Workspace/Application/logmanagerimplunthreaded.h>

Inherits LogManagerImpl.

Public Types

using FilterSet = QSet< DataExecution::LogStreamFilter >
 

Public Member Functions

 LogManagerImplUnthreaded ()
 
 ~LogManagerImplUnthreaded () override
 
void addStream (DataExecution::LogStream &logStream) override
 
bool filterMessage (const QString &msg, const QString &category, const QThread *currThread, const QThread *parentThread) override
 
void flush () override
 
void flushAsync () override
 
QList< const DataExecution::LogStream * > getStreams () const override
 
bool installFilter (const DataExecution::LogStreamFilter &filter) 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
 

Public Attributes

FilterSet filters_
 

Detailed Description

This is the implementation of the LogManager that will be used if being used in an application that does not involve a QCoreApplication. It is needed to avoid situations where the logging thread is not shut down properly because it was killed before events were fully processed. The LogManagerImplThreaded is able to handle this, but only if a QCoreApplication exists. We therefore detect the non-existence of the QCoreApplication (in LogManager) and instantiate this class instead.

See also
LogManagerImplThreaded

Member Typedef Documentation

◆ FilterSet

Constructor & Destructor Documentation

◆ LogManagerImplUnthreaded()

◆ ~LogManagerImplUnthreaded()

~LogManagerImplUnthreaded ( )
overridedefault

Member Function Documentation

◆ addStream()

void addStream ( DataExecution::LogStream logStream)
override

◆ filterMessage()

bool filterMessage ( const QString &  msg,
const QString &  category,
const QThread *  currThread,
const QThread *  parentThread 
)
override
Returns
true if the message was accepted by the various filters, false if it was rejected and should therefore not be displayed.
Note
Only invoked from within the logging (rwThread_) thread.

◆ flush()

void flush ( )
override

Flush the log (synchronously).

◆ flushAsync()

void flushAsync ( )
override

Flush the log (asynchronously).

◆ getStreams()

QList< const DataExecution::LogStream * > getStreams ( ) const
override

Retrieves all streams

◆ installFilter()

bool installFilter ( const DataExecution::LogStreamFilter filter)
override
Parameters
filterThe filter to install

Installs a message filter.

Returns
true if the filter was installed correctly, false otherwise.

◆ logText()

void logText ( const QString &  msg,
const QString &  category 
)
override

Synchronous version of the logText function.

◆ logTextAsync()

void logTextAsync ( const QString &  msg,
const QString &  category 
)
override

Asynchronous version of the logText function.

◆ removeFilter()

bool removeFilter ( const DataExecution::LogStreamFilter filter)
override

◆ removeStream()

bool removeStream ( DataExecution::LogStream logStream)
override

Removes a stream (synchronously).

Member Data Documentation

◆ filters_

FilterSet filters_