Signals | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions

conan::SignalLogger Class Reference

Controls the logging of signal emissions. More...

#include <SignalSpy.h>

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

conan::SignalLogger::SignalLogger (  ) 

Creates a SignalLogger that initially only logs the signal signature and arguments.


Member Function Documentation

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!!!


Member Data Documentation

const unsigned conan::SignalLogger::kDynamicWidth = 0 [static]

Indicates a dynamic field width.

signal emit count field width

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.

signal signature field width


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