-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlog.h
More file actions
59 lines (53 loc) · 1.63 KB
/
log.h
File metadata and controls
59 lines (53 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef LOG_H
#define LOG_H
#include "utilsexport.h"
#include <QMap>
#include <QMutex>
#include <QString>
#include <QDomDocument>
class UTILS_EXPORT Log
{
public:
enum LogFormat {
Simple,
HTML,
Both
};
enum LogType {
Error = 0x0001,
Warning = 0x0002,
Detaile = 0x0004,
Stanza = 0x0008,
Debug = 0x0010
};
static QString logFileName();
static QString logPath();
static void setLogPath(const QString &APath);
static LogFormat logFormat();
static void setLogFormat(LogFormat AFormap);
static uint logTypes();
static void setLogTypes(uint AType);
static int maxLogSize();
static void setMaxLogSize(int AKBytes);
static void writeMessage(uint AType, const QString &AMessage);
public:
static QString generateBacktrace();
static void setStaticReportParam(const QString &AKey, const QString &AValue);
static QDomDocument generateReport(QMap<QString, QString> &AParams, bool AIncludeLog = true);
static bool sendReport(QDomDocument AReport);
private:
static QMutex FMutex;
static uint FLogTypes;
static uint FMaxLogSize;
static QString FLogFile;
static QString FLogPath;
static LogFormat FLogFormat;
static QMap<QString,QString> FReportParams;
};
void UTILS_EXPORT LogError(const QString &AMessage);
void UTILS_EXPORT LogWarning(const QString &AMessage);
void UTILS_EXPORT LogDetail(const QString &AMessage);
void UTILS_EXPORT LogStanza(const QString &AMessage);
void UTILS_EXPORT LogDebug(const QString &AMessage);
void UTILS_EXPORT ReportError(const QString &ACode, const QString &ADescr, bool AIncludeLog = true);
#endif // LOG_H