Emdee
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
8  }
9 
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&);
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