QtWebApp
logmessage.h
Go to the documentation of this file.
1 
6 #ifndef LOGMESSAGE_H
7 #define LOGMESSAGE_H
8 
9 #include <QtGlobal>
10 #include <QDateTime>
11 #include <QHash>
12 #include "logglobal.h"
13 
14 namespace stefanfrings {
15 
36 class DECLSPEC LogMessage
37 {
38  Q_DISABLE_COPY(LogMessage)
39 public:
40 
51  LogMessage(const QtMsgType type, const QString& message, const QHash<QString,QString>* logVars,
52  const QString &file, const QString &function, const int line);
53 
61  QString toString(const QString& msgFormat, const QString& timestampFormat) const;
62 
66  QtMsgType getType() const;
67 
68 private:
69 
71  QHash<QString,QString> logVars;
72 
74  QDateTime timestamp;
75 
77  QtMsgType type;
78 
80  Qt::HANDLE threadId;
81 
83  QString message;
84 
86  QString file;
87 
89  QString function;
90 
92  int line;
93 
94 };
95 
96 } // end of namespace
97 
98 #endif // LOGMESSAGE_H
Represents a single log message together with some data that are used to decorate the log message.
Definition: logmessage.h:37