-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.h
More file actions
79 lines (69 loc) · 2.71 KB
/
logger.h
File metadata and controls
79 lines (69 loc) · 2.71 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef _LOGGER_H_
#define _LOGGER_H_
#include "appender.h"
/* Author: Alexander Issayev
*
* Provides logging functionality. Should be
* instantiated on a per-class basis.
*/
#define LOG_INFO __FILE__, __LINE__, __func__
namespace simple_log {
class Logger{
public:
/* Make logger for a class
*
* name: class name
*/
Logger(const char * name) : name(name) { }
/* Log given message at the given level.
*
* Fatal: Program cannot continue past this point
* Error: A significant program error.
* Warn: Possibly an error, but program will function.
* Info: General status messages.
* Debug: Debugging level messages.
* Trace: Very low level trace info
*/
void Fatal(const char * msg);
void Error(const char * msg);
void Warn(const char * msg);
void Info(const char * msg);
void Debug(const char * msg);
void Trace(const char * msg);
/* Pass additional information by means of macro expansion */
void Fatal(const char * msg, const char * file, int line,
const char * function);
void Error(const char * msg, const char * file, int line,
const char * function);
void Warn(const char * msg, const char * file, int line,
const char * function);
void Info(const char * msg, const char * file, int line,
const char * function);
void Debug(const char * msg, const char * file, int line,
const char * function);
void Trace(const char * msg, const char * file, int line,
const char * function);
/* As above but with formatting */
void fFatal(const char * fstr, ...);
void fError(const char * fstr, ...);
void fWarn(const char * fstr, ...);
void fInfo(const char * fstr, ...);
void fDebug(const char * fstr, ...);
void fTrace(const char * fstr, ...);
void fFatal(const char * fstr, const char * file, int line,
const char * function, ...);
void fError(const char * fstr, const char * file, int line,
const char * function, ...);
void fWarn(const char * fstr, const char * file, int line,
const char * function, ...);
void fInfo(const char * fstr, const char * file, int line,
const char * function, ...);
void fDebug(const char * fstr, const char * file, int line,
const char * function, ...);
void fTrace(const char * fstr, const char * file, int line,
const char * function, ...);
private:
const char * name;
};
}
#endif