-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogger.h
44 lines (36 loc) · 834 Bytes
/
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
#ifndef SLOGGER_H
#define SLOGGER_H
#include <QString>
#include <QStringList>
#include <QMutex>
#include <QObject>
class Logger: public QObject {
Q_OBJECT
public:
explicit Logger(QObject *parent = 0);
/**
This method is used when adding an entry to the log. Will
automatically add a timestamp when added.
*/
void addEntry(QString errorMessage);
/**
Returns an entry specified by entryNumber
*/
QString getEntry(int entryNumber);
/**
Returns the total amount of entries
*/
int getTotalEntries();
private:
QMutex *SLoggerLock;
QStringList *logEntries;
char m_dateStr[9];
char m_timeStr[9];
signals:
/**
Signals to the GUI when a logentry is added.
*/
void logEntryAdded();
};
extern Logger*logger;
#endif // SLOGGER_H