-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfbErrorLogger.h
More file actions
60 lines (46 loc) · 1.51 KB
/
fbErrorLogger.h
File metadata and controls
60 lines (46 loc) · 1.51 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
60
/* $Id: fbErrorLogger.h,v 1.9 2008/04/20 15:29:11 wyverex Exp $ */
#ifndef fbERRORLOGGER_H
#define fbERRORLOGGER_H
#include "global.h"
#include "fbErrorLevel.h"
#include "fbErrorCodes.h"
#include "fbCriticalSection.h"
/**
* fbErrorLogger
* Error Logger
* @author Byron Heads
* @date March 07, 2008
* @note 3/7/08 - Created fbErrorLogger
*/
class fbErrorLogger
{
public:
fbErrorLogger(ostream& stream); ///< Refrence
fbErrorLogger(ostream* stream); /// < Pointer
~fbErrorLogger();
/// Print via char string
void print(ERROR_LEVEL lvl, ERROR_CODES code, const char* str);
/// Print via c++ string
void print(ERROR_LEVEL lvl, ERROR_CODES code, string& str);
//ErrorLogger Functions
///Prints Errors to log, Errors kill the system
void err(ERROR_CODES code, const char* str, ...);
void err(ERROR_CODES code, string& str);
/// Prints warnings
void warn(ERROR_CODES code, const char* str, ...);
void warn(ERROR_CODES code, string& str);
/// Prints messages
void msg(ERROR_CODES code, const char* str, ...);
void msg(ERROR_CODES code, string& str);
/// Prints Debug Information
void debug(ERROR_CODES code, const char* str, ...);
void debug(ERROR_CODES code, string& str);
private:
ostream* out; /// < file stream to log
fbCriticalSection cs; ///< lock on writing to the log
void errordate(string& date); ///< adds date time to a string
/// Remains of error string generation...
static void errorlevel(ERROR_LEVEL lvl, string& level);
static void errordesc(ERROR_CODES code, string& desc);
};
#endif