Stop to define DISALLOW_EVIL_CONSTRUCTORS to avoid name conflict.
[platform/upstream/glog.git] / src / glog / log_severity.h
1 // Copyright 2007 Google Inc. All Rights Reserved.
2
3 #ifndef BASE_LOG_SEVERITY_H__
4 #define BASE_LOG_SEVERITY_H__
5
6 // Variables of type LogSeverity are widely taken to lie in the range
7 // [0, NUM_SEVERITIES-1].  Be careful to preserve this assumption if
8 // you ever need to change their values or add a new severity.
9 typedef int LogSeverity;
10
11 const int INFO = 0, WARNING = 1, ERROR = 2, FATAL = 3, NUM_SEVERITIES = 4;
12
13 // DFATAL is FATAL in debug mode, ERROR in normal mode
14 #ifdef NDEBUG
15 #define DFATAL_LEVEL ERROR
16 #else
17 #define DFATAL_LEVEL FATAL
18 #endif
19
20 extern const char* const LogSeverityNames[NUM_SEVERITIES];
21
22 // NDEBUG usage helpers related to (RAW_)DCHECK:
23 //
24 // DEBUG_MODE is for small !NDEBUG uses like
25 //   if (DEBUG_MODE) foo.CheckThatFoo();
26 // instead of substantially more verbose
27 //   #ifndef NDEBUG
28 //     foo.CheckThatFoo();
29 //   #endif
30 //
31 // IF_DEBUG_MODE is for small !NDEBUG uses like
32 //   IF_DEBUG_MODE( string error; )
33 //   DCHECK(Foo(&error)) << error;
34 // instead of substantially more verbose
35 //   #ifndef NDEBUG
36 //     string error;
37 //     DCHECK(Foo(&error)) << error;
38 //   #endif
39 //
40 #ifdef NDEBUG
41 enum { DEBUG_MODE = 0 };
42 #define IF_DEBUG_MODE(x)
43 #else
44 enum { DEBUG_MODE = 1 };
45 #define IF_DEBUG_MODE(x) x
46 #endif
47
48 #endif  // BASE_LOG_SEVERITY_H__