swift
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Friends | List of all members
swift::misc::CLogHandler Class Reference

Class for subscribing to log messages. More...

Inheritance diagram for swift::misc::CLogHandler:
[legend]

Public Slots

void logLocalMessage (const swift::misc::CStatusMessage &message)
 Called by our QtMessageHandler to log a message.
 
void logRemoteMessage (const swift::misc::CStatusMessage &message)
 Called by the context to relay a message.
 
void enableConsoleOutput (bool enable)
 Enable or disable the default Qt handler.
 

Signals

void localMessageLogged (const swift::misc::CStatusMessage &message)
 Emitted when a message is logged in this process.
 
void remoteMessageLogged (const swift::misc::CStatusMessage &message)
 Emitted when a log message is relayed from a different process.
 
void subscriptionAdded (const swift::misc::CLogPattern &pattern)
 Emitted when an object subscribes to a pattern of log messages.
 
void subscriptionRemoved (const swift::misc::CLogPattern &pattern)
 Emitted when an object unsubscribes from a pattern of log messages.
 

Public Member Functions

void install (bool skipIfAlreadyInstalled=false)
 Tell the CLogHandler to install itself with qInstallMessageHandler.
 
CLogPatternHandlerhandlerForPattern (const CLogPattern &pattern)
 Return a pattern handler for subscribing to all messages which match the given pattern. More...
 
CLogPatternHandlerhandlerForCategory (const CLogCategory &category)
 Return a pattern handler for subscribing to all messages which contain the given category. More...
 
CLogPatternHandlerhandlerForValidation ()
 Return a pattern handler for subscribing to all validation warnings and errors. More...
 
QList< CLogPatterngetAllSubscriptions () const
 Returns all log patterns for which there are currently subscribed log pattern handlers.
 

Static Public Member Functions

static CLogHandlerinstance ()
 Return pointer to the CLogHandler singleton. More...
 

Friends

class CLogPatternHandler
 

Detailed Description

Class for subscribing to log messages.

Definition at line 36 of file loghandler.h.

Member Function Documentation

◆ handlerForCategory()

CLogPatternHandler* swift::misc::CLogHandler::handlerForCategory ( const CLogCategory category)

Return a pattern handler for subscribing to all messages which contain the given category.

Warning
This must only be called from the main thread.

◆ handlerForPattern()

CLogPatternHandler* swift::misc::CLogHandler::handlerForPattern ( const CLogPattern pattern)

Return a pattern handler for subscribing to all messages which match the given pattern.

Warning
This must only be called from the main thread.

◆ handlerForValidation()

CLogPatternHandler* swift::misc::CLogHandler::handlerForValidation ( )
inline

Return a pattern handler for subscribing to all validation warnings and errors.

Warning
This must only be called from the main thread.

Definition at line 64 of file loghandler.h.

◆ instance()

static CLogHandler* swift::misc::CLogHandler::instance ( )
static

Return pointer to the CLogHandler singleton.

Warning
This can not be called from within a plugin, because the returned instance will be wrong.

The documentation for this class was generated from the following file: