-
Notifications
You must be signed in to change notification settings - Fork 2
/
AtlasLogger.h
42 lines (32 loc) · 983 Bytes
/
AtlasLogger.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
#pragma once
#include <string>
#include <list>
enum ErrorSeverity { FATALERROR = 0, WARNING };
typedef struct AtlasError
{
std::string Error;
ErrorSeverity Severity;
unsigned int LineNumber;
} AtlasError;
typedef std::list<AtlasError>::iterator ListErrorIt;
class AtlasLogger
{
public:
AtlasLogger();
~AtlasLogger();
void ReportError(unsigned int ScriptLine, const char* FormatStr ...);
void ReportWarning(unsigned int ScriptLine, const char* FormatStr ...);
void Log(const char* FormatStr ...);
void SetLogSource(FILE* OutputSource);
void SetLogStatus(bool LoggingOn);
void BugReportLine(unsigned int Line, const char* Filename, const char* Msg);
void BugReport(unsigned int Line, const char* Filename, const char* FormatStr ...);
std::list<AtlasError> Errors;
private:
FILE* output;
static const unsigned int BufSize = 2048;
char buf[BufSize];
bool isLogging;
};
extern AtlasLogger Logger;
#define ReportBug(msg) Logger.BugReport(__LINE__, __FILE__, msg)