Fraxinus  22.04-rc5
An IGT application
cxLogMessage.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXLOGMESSAGE_H
13 #define CXLOGMESSAGE_H
14 
15 #include "cxResourceExport.h"
16 
17 //#define SSC_PRINT_CALLER_INFO
18 
19 #include <QMetaType>
20 #include <QObject>
21 #include <QMutex>
22 #include <QDateTime>
23 #include <QFile>
24 #include "boost/shared_ptr.hpp"
25 #include "cxDefinitions.h"
26 #include "cxAudio.h"
27 #include <sstream>
28 #include "cxTypeConversions.h"
29 #include "cxLogger.h"
30 
31 class QString;
32 class QDomNode;
33 class QDomDocument;
34 class QFile;
35 class QTextStream;
36 
43 namespace cx
44 {
45 
54 class cxResource_EXPORT Message
55 {
56 public:
57  Message(QString text ="", MESSAGE_LEVEL messageLevel=mlDEBUG, int timeoutTime=-1);
58  ~Message();
59 
60  QString getPrintableMessage() const;
61  MESSAGE_LEVEL getMessageLevel() const;
62  QString getText() const;
63  QDateTime getTimeStamp() const;
64  int getTimeout() const;
65  QString getSourceLocation() const;
66 
67  //private:
68  QString mText;
69  MESSAGE_LEVEL mMessageLevel;
71  QDateTime mTimeStamp;
72  bool mMuted;
73  // QString mSourceLocation; ///< file:line/function
74  QString mChannel;
75  QString mThread;
76 
77  QString mSourceFile;
78  QString mSourceFunction;
80 private:
81  void setThreadName();
82 };
83 
84 } //namespace cx
85 
88 
93 #endif // CXLOGMESSAGE_H
Q_DECLARE_METATYPE(Message)
QString mSourceFile
Definition: cxLogMessage.h:77
QString mThread
Definition: cxLogMessage.h:75
mlDEBUG
Definition: cxDefinitions.h:67
MESSAGE_LEVEL mMessageLevel
Definition: cxLogMessage.h:69
QString mChannel
Definition: cxLogMessage.h:74
cx::Message Message
Definition: cxLogMessage.h:86
QDateTime mTimeStamp
Definition: cxLogMessage.h:71
int mTimeoutTime
Definition: cxLogMessage.h:70
QString mSourceFunction
Definition: cxLogMessage.h:78
QString mText
Definition: cxLogMessage.h:68
Namespace for all CustusX production code.