-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logger.h
50 lines (34 loc) · 1.12 KB
/
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
45
46
47
48
49
50
// Copyright 2006-12 HumaNature Studios Inc.
#ifndef __LOGGER_H__
#define __LOGGER_H__
namespace core {
class Logger
: public Subscription
{
public:
enum Severity
{
kForce, // force is a special case, it will always be logged
kTrace,
kDebug,
kInfo,
kWarn,
kError,
kFatal,
};
// always show severities above this, defaults to kInfo
Severity showAbove;
// always hide severities below this, defaults to kInfo
Severity hideBelow;
Logger();
virtual ~Logger();
void ignore(const char* category);
bool shouldLog(Severity severity, const CompactStringRelease& category);
void log(Severity severity, const char* category, const char* message, ...);
virtual void logVargs(Severity severity, const CompactStringDebug& category, const char* message, va_list& vargs) = 0;
protected:
static const char* severityStrings[];
Subscription ignoreCategories;
};
} // namespace core
#endif // __LOGGER_H__