Public Member Functions

LogMessage Class Reference

Represents a single log message together with some data that are used to decorate the log message. More...

#include <logmessage.h>

List of all members.

Public Member Functions

 LogMessage (const QtMsgType type, const QString &message, QHash< QString, QString > *logVars)
 Constructor.
QString toString (const QString &msgFormat, const QString &timestampFormat) const
 Returns the log message as decorated string.
QtMsgType getType () const
 Get the message type.

Detailed Description

Represents a single log message together with some data that are used to decorate the log message.

The following variables may be used in the message and in msgFormat:

Definition at line 27 of file logmessage.h.


Constructor & Destructor Documentation

LogMessage::LogMessage ( const QtMsgType  type,
const QString &  message,
QHash< QString, QString > *  logVars 
)

Constructor.

All parameters are copied, so that later changes to them do not affect this object.

Parameters:
type Type of the message
message Message text
logVars Logger variables, 0 is allowed

Definition at line 9 of file logmessage.cpp.


Member Function Documentation

QString LogMessage::toString ( const QString &  msgFormat,
const QString &  timestampFormat 
) const

Returns the log message as decorated string.

Parameters:
msgFormat Format of the decoration. May contain variables and static text, e.g. "{timestamp} {type} thread={thread}: {msg}"
timestampFormat Format of timestamp, e.g. "dd.MM.yyyy hh:mm:ss.zzz"
See also:
QDatetime for a description of the timestamp format pattern

Definition at line 22 of file logmessage.cpp.


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