swift
|
A helper class for subscribing to log messages matching a particular pattern, with the ability to change the pattern at runtime. More...
Public Member Functions | |
CLogSubscriber (QObject *parent=nullptr) | |
Default constructor, for when you're not interested in messages and just want to control the console output. | |
template<typename T , typename F > | |
CLogSubscriber (T *parent, F slot) | |
Construct a subscriber which forwards messages to the given slot of parent. | |
void | changeSubscription (const CLogPattern &pattern) |
Change the pattern which you want to subscribe to. More... | |
void | unsubscribe () |
Unsubscribe from all messages. More... | |
void | enableConsoleOutput (bool enable) |
Enable or disable the default Qt handler for messages which match the relevant pattern. More... | |
void | inheritConsoleOutput () |
The policy of whether to enable or disable the default Qt handler for messages which match the relevant pattern will be inherited from the base CLogHandler, or from another CLogPatternHandler which matches a superset of the messages which this one matches. More... | |
A helper class for subscribing to log messages matching a particular pattern, with the ability to change the pattern at runtime.
Also provides a thread-safe API for interacting with the CLogHandler.
Definition at line 219 of file loghandler.h.
void swift::misc::CLogSubscriber::changeSubscription | ( | const CLogPattern & | pattern | ) |
Change the pattern which you want to subscribe to.
void swift::misc::CLogSubscriber::enableConsoleOutput | ( | bool | enable | ) |
Enable or disable the default Qt handler for messages which match the relevant pattern.
The setting of this property in one CLogPatternHandler can override the setting in another CLogPatternHandler or the base CLogHandler, if this handler's pattern is a subset of the other handler's pattern. Which is to say, more specific patterns can override less specific patterns.
void swift::misc::CLogSubscriber::inheritConsoleOutput | ( | ) |
The policy of whether to enable or disable the default Qt handler for messages which match the relevant pattern will be inherited from the base CLogHandler, or from another CLogPatternHandler which matches a superset of the messages which this one matches.
This is the default, but can be used to reverse the effect of calling enableConsoleOutput.
void swift::misc::CLogSubscriber::unsubscribe | ( | ) |
Unsubscribe from all messages.