-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.h
49 lines (43 loc) · 1.07 KB
/
logger.h
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
#ifndef LOGGER_H
#define LOGGER_H
#include <QObject>
#include <QFile>
#include <QDir>
#include <QVariantMap>
#include <QQueue>
class Logger : public QObject
{
Q_OBJECT
public:
Logger();
public slots:
void startLog();
void stopLog();
void setBin(bool);
void setTxt(bool);
void setJson(bool);
void setProfileName(QString);
void incomingBinData(const QByteArray data);
void incomingTxtData(const QString string);
void incomingJsonData(const QVariantMap jsonMap);
private:
QFile newBinFile;
QFile newLogFile;
QFile newJsonFile;
QString binFileName;
QString logFileName;
QString jsonFileName;
bool bin, txt, json;
bool createNewBinFileNamePermission, createNewJsonFileNamePermission, createNewTxtFileNamePermission;
QDateTime returnTimestamp();
QString sessionName;
QString appHomeDir;
QDir dir;
QString currentProfileName;
bool writeLogsPermission = false;
QQueue<QString> txtLogQueue;
signals:
void showStatusMessage(QString);
void toTextLog(QString, bool);
};
#endif // LOGGER_H