-
Notifications
You must be signed in to change notification settings - Fork 0
/
ILogger.h
41 lines (35 loc) · 1.26 KB
/
ILogger.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
#ifndef ILOGGER_H
#define ILOGGER_H
#include "DefinitionsAndIncludes.h"
#define LOG_FILENAME L"log.txt"
class ILogger
{
bool logEnabled; //âêëþ÷åíî ëè ïðîòîêîëèðîâàíèå
bool logSuccessful; // ïðîòîêîëèðîâàòü óñïåøíûå îïåðàöèè
bool logErrors; // ïðîòîêîëèðîâàòü îøèáêè
bool fileOpenSuccessful; // ôàéë óñïåøíî îòêðûò
bool fileOpenAttempt; // ïîïûòêà îòêðûòü ôàéë
bool supressFileOutput; // ïîäàâëÿòü âûâîä â òåêñòîâîé ôàéë
bool supressDialogOutput; // ïîäàâëÿòü âûâîä â äèàëîãîâîå îêíî
FILE *outputFile;
wchar_t buffer[512]; //áóôôåð äëÿ õðàíåíèÿ ôîðìàòèðîâàííîé ñòðîêè
wchar_t tbuffer[64];
time_t rawTime;
struct tm timeInfo;
int iteratorI;
int iteratorJ;
friend void LOG(wchar_t *format, ...);
friend void eLOG(wchar_t *format, ...);
public:
void EnableLog(bool enable = true) { this->logEnabled = enable; }
void LogSucc(bool enable = true) { this->logSuccessful = enable; }
void LogErrors(bool enable = true) { this->logErrors = enable; }
void SuppresFileOutput(bool enable = true){ this->supressFileOutput = enable; }
void SuppessDialogOutput(bool enable = true) { this->supressDialogOutput = enable; }
ILogger();
~ILogger();
};
extern ILogger logger;
void LOG(wchar_t *format, ...);
void eLOG(wchar_t *format, ...);
#endif