Workspace 6.21.5
Classes | Public Member Functions | Static Public Member Functions | List of all members
DistributedLogManager Class Reference

Singleton for managing the logging streams associated with execution threads.

#include <Workspace/Application/distributedlogmanager.h>

Classes

struct  ProcessInfo
 

Public Member Functions

 DistributedLogManager (const DistributedLogManager &)=delete
 
void addLog (DataExecution::DistributedLogPackage &package)
 
void addSink (DataExecution::DistributedLogSink &logStream)
 
const ProcessInfogetProcessInfo () const
 
const QList< DataExecution::DistributedLogSink * > & getSinks () const
 
DistributedLogManageroperator= (const DistributedLogManager &)=delete
 
bool removeSink (DataExecution::DistributedLogSink &logStream)
 

Static Public Member Functions

static DistributedLogManagergetInstance ()
 

Constructor & Destructor Documentation

◆ DistributedLogManager()

Member Function Documentation

◆ addLog()

void addLog ( DataExecution::DistributedLogPackage package)
Parameters
packageThe log package to send

◆ addSink()

void addSink ( DataExecution::DistributedLogSink logSink)
Parameters
logSinkThe DistributedLogSink object to use as the main sink for the application. It is the caller's responsibility to ensure that logStream survives for the life of the application or until the sink is popped off the main log sink list through a call to removeSink().
Warning
This function should only be called at a time when it can be guaranteed that nothing will try to write to the main log sink. There are no protections against race conditions when pushing or popping the log sink list.
See also
removeSink()

◆ getInstance()

DistributedLogManager & getInstance ( )
static
Returns
The LogManager singleton instance used by the application.

◆ getProcessInfo()

const DistributedLogManager::ProcessInfo & getProcessInfo ( ) const

◆ getSinks()

const QList< DataExecution::DistributedLogSink * > & getSinks ( ) const
Returns
Read only list of current log streams

◆ operator=()

DistributedLogManager & operator= ( const DistributedLogManager )
delete

◆ removeSink()

bool removeSink ( DataExecution::DistributedLogSink logSink)
Parameters
logSinkThe log sink to remove off the list.
Warning
This function should only be called at a time when it can be guaranteed that nothing will try to write to the main log stream. There are no protections against race conditions when pushing or popping the log sink list.
Returns
True if the logStream exisited in the list and has been removed.
See also
addSink()