Mantid
|
Provides a translation layer that takes a Poco::Message and converts it to a Qt signal. More...
#include <QtSignalChannel.h>
Public Slots | |
void | setGlobalLogLevel (int level) |
Set the log level for all loggers. More... | |
Signals | |
void | messageReceived (const Message &msg) |
Public Member Functions | |
void | log (const Poco::Message &msg) override |
Converts the Poco::Message to a Qt signal. More... | |
QtSignalChannel (QString source="") | |
Default constructor. More... | |
void | setSource (const QString &source) |
If set, only Mantid log messages from this source are emitted. More... | |
const QString & | source () const |
Get the current source are emitted. More... | |
~QtSignalChannel () override | |
Destructor. More... | |
Private Member Functions | |
QtSignalChannel & | operator= (const QtSignalChannel &)=delete |
QtSignalChannel (const QtSignalChannel &)=delete | |
Private Attributes | |
QString | m_source |
Optional source (use std::string to avoid conversion in comparison) More... | |
Provides a translation layer that takes a Poco::Message and converts it to a Qt signal.
Definition at line 25 of file QtSignalChannel.h.
MantidQt::MantidWidgets::QtSignalChannel::QtSignalChannel | ( | QString | source = "" | ) |
Default constructor.
Creates a QtSignalChannel.
This channel receives Poco::Message objects and re-emits MantidQt Message objects with the option to specify that only messages from a defined source are emitted.
source | A string specifying a source for the message |
Definition at line 24 of file QtSignalChannel.cpp.
|
overridedefault |
Destructor.
|
privatedelete |
|
override |
Converts the Poco::Message to a Qt signal.
If the source is set then only messages with a matching source cause a Qt signal to be emitted.
A newline is appended as the Poco log stream emits the message when a newline is received but doesn't actually send a newline character
msg | A Poco message object containing a priority & the string message |
Definition at line 41 of file QtSignalChannel.cpp.
References m_source, and messageReceived().
|
signal |
Referenced by log().
|
privatedelete |
|
slot |
Set the log level for all loggers.
Definition at line 51 of file QtSignalChannel.cpp.
References Mantid::Kernel::Logger::setLevelForAll().
void MantidQt::MantidWidgets::QtSignalChannel::setSource | ( | const QString & | source | ) |
If set, only Mantid log messages from this source are emitted.
source | A string specifying the required source for messages that will be emitted |
Definition at line 32 of file QtSignalChannel.cpp.
References m_source, and source().
Referenced by MantidQt::MantidWidgets::MessageDisplay::setSource().
|
inline |
Get the current source are emitted.
Definition at line 37 of file QtSignalChannel.h.
Referenced by setSource().
|
private |
Optional source (use std::string to avoid conversion in comparison)
Definition at line 56 of file QtSignalChannel.h.
Referenced by log(), and setSource().