Emdee
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
libs
utils
glogfallback.h
Go to the documentation of this file.
1
#ifndef GLOGFALLBACK_H
2
#define GLOGFALLBACK_H
3
4
#include <iostream>
5
6
struct
FallbackLogger
{
7
FallbackLogger
() {
8
}
9
10
~FallbackLogger
() {
11
std::cout << m_SS.str() << std::endl;
12
}
13
14
public
:
15
// accepts just about anything
16
template
<
class
T>
17
FallbackLogger
&
operator<<
(
const
T &x) {
18
m_SS << x;
19
return
*
this
;
20
}
21
// accepts endl
22
typedef
std::ostream& (
manip
)(std::ostream&);
23
FallbackLogger
&
operator<<
(
manip
& m) {
24
(void)m;
25
return
*
this
;
26
}
27
private
:
28
std::ostringstream m_SS;
29
};
30
31
#ifndef LOG
32
#define LOG(severity) FallbackLogger() << "LOG: "
33
#endif
34
35
#ifndef INFO
36
#define INFO
37
#endif
38
39
#ifndef DEBUG
40
#define DEBUG
41
#endif
42
43
#ifndef WARNING
44
#define WARNING
45
#endif
46
47
#ifndef ERROR
48
#define ERROR
49
#endif
50
51
#ifndef FATAL
52
#define FATAL
53
#endif
54
55
#endif // GLOGFALLBACK_H
Generated on Sun Jun 22 2014 13:59:21 for Emdee by
1.8.4