Controls the logging of signal emissions. More...
#include <SignalSpy.h>
Signals | |
void | SignalSpyLog (const QString &msg) |
Subscribe to all signal spy log messages. Never ever connect a spy to this signal!!! | |
Public Member Functions | |
SignalLogger () | |
Creates a SignalLogger that initially only logs the signal signature and arguments. | |
void | Log (SignalSpy *inSpy, const QString &inArgs) |
Outputs a single signal emission for the given signal spy and signal arguments. | |
QString | GetExampleLog () const |
Returns an example signal spy log based on the current log options. | |
Public Attributes | |
bool | mShowTimestamp |
Controls timestamp field. | |
bool | mShowObject |
Controls object field. | |
bool | mShowAddress |
Controls address field. | |
bool | mShowSignature |
Controls signal signature field. | |
bool | mShowEmitCount |
Controls signal emit count field. | |
bool | mShowArguments |
Controls arguments field. | |
unsigned | mObjectWidth |
object field width | |
unsigned | mSignatureWidth |
signal signature field width | |
unsigned | mEmitCountWidth |
signal emit count field width | |
bool | mPrettyFormatting |
indicates if log message fields should be alligned between logs | |
QChar | mSeparator |
the character used for seperating log message fields | |
Static Public Attributes | |
static const unsigned | kDynamicWidth = 0 |
Indicates a dynamic field width. | |
Private Member Functions | |
QString | BuildLogMessage (const MethodData &inSignalData, int inEmitCount, const QString &inArgs) const |
Returns the log message created for the given signal emission data. |
Controls the logging of signal emissions.
The SignalLogger uses the following log format: [timestamp] | [object] | [address] | [signature] | #[emit count] | [signal emission arguments]
Each individual part of the log can be enabled or disabled. Furthermore, the width of each part can be fixed to a custom value or kept dynamic. Fixed fields are truncated when the text is too long or padded with spaces when the text is too short.
All logging is performed using qDebug calls.
conan::SignalLogger::SignalLogger | ( | ) |
Creates a SignalLogger that initially only logs the signal signature and arguments.
QString conan::SignalLogger::BuildLogMessage | ( | const MethodData & | inSignalData, | |
int | inEmitCount, | |||
const QString & | inArgs | |||
) | const [private] |
Returns the log message created for the given signal emission data.
QString conan::SignalLogger::GetExampleLog | ( | ) | const |
Returns an example signal spy log based on the current log options.
void conan::SignalLogger::Log | ( | SignalSpy * | inSpy, | |
const QString & | inArgs | |||
) |
Outputs a single signal emission for the given signal spy and signal arguments.
void conan::SignalLogger::SignalSpyLog | ( | const QString & | msg | ) | [signal] |
Subscribe to all signal spy log messages. Never ever connect a spy to this signal!!!
const unsigned conan::SignalLogger::kDynamicWidth = 0 [static] |
Indicates a dynamic field width.
unsigned conan::SignalLogger::mEmitCountWidth |
signal emit count field width
unsigned conan::SignalLogger::mObjectWidth |
object field width
indicates if log message fields should be alligned between logs
the character used for seperating log message fields
Controls address field.
Controls arguments field.
Controls signal emit count field.
Controls object field.
Controls signal signature field.
Controls timestamp field.
unsigned conan::SignalLogger::mSignatureWidth |
signal signature field width