Represents a single log message together with some data that are used to decorate the log message. More...
#include <logmessage.h>
Public Member Functions | |
LogMessage (const QtMsgType type, const QString &message, QHash< QString, QString > *logVars) | |
Constructor. | |
QString | toString (const QString &msgFormat, const QString ×tampFormat) const |
Returns the log message as decorated string. | |
QtMsgType | getType () const |
Get the message type. |
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.
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.
type | Type of the message | |
message | Message text | |
logVars | Logger variables, 0 is allowed |
Definition at line 9 of file logmessage.cpp.
QString LogMessage::toString | ( | const QString & | msgFormat, | |
const QString & | timestampFormat | |||
) | const |
Returns the log message as decorated string.
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" |
Definition at line 22 of file logmessage.cpp.