console_bridge
console.h
Go to the documentation of this file.
1 #ifndef ROCK_CONSOLE_BRIDGE_CONSOLE_H
2 #define ROCK_CONSOLE_BRIDGE_CONSOLE_H
3 
4 #include <base-logging/Logging.hpp>
5 
6 
7 #ifdef __GNUC__
8 #define CONSOLE_BRIDGE_DEPRECATED __attribute__ ((deprecated))
9 #elif defined(_MSC_VER)
10 #define CONSOLE_BRIDGE_DEPRECATED __declspec(deprecated)
11 #else
12 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
13 #define CONSOLE_BRIDGE_DEPRECATED
14 #endif
15 
16 static inline void CONSOLE_BRIDGE_DEPRECATED console_bridge_deprecated() {}
17 
40 #define CONSOLE_BRIDGE_logError(fmt, ...) do { \
41  LOG_ERROR(fmt, ##__VA_ARGS__); } while(0)
42 
43 #define CONSOLE_BRIDGE_logWarn(fmt, ...) do { \
44  LOG_WARN(fmt, ##__VA_ARGS__); } while(0)
45 
46 #define CONSOLE_BRIDGE_logInform(fmt, ...) do { \
47  LOG_INFO(fmt, ##__VA_ARGS__); } while(0)
48 
49 #define CONSOLE_BRIDGE_logDebug(fmt, ...) do { \
50  LOG_DEBUG(fmt, ##__VA_ARGS__); } while(0)
51 
52 
53 #define logDebug(FORMAT, ARGS...) do { \
54  console_bridge_deprecated(); \
55  LOG_DEBUG(FORMAT, ## ARGS); } while(0)
56 
57 #define logInfo(FORMAT, ARGS...) do { \
58  console_bridge_deprecated(); \
59  LOG_INFO(FORMAT, ## ARGS); } while(0)
60 
61 #define logWarn(FORMAT, ARGS...) do { \
62  console_bridge_deprecated(); \
63  LOG_WARN(FORMAT, ## ARGS); } while(0)
64 
65 #define logError(FORMAT, ARGS...) do { \
66  console_bridge_deprecated(); \
67  LOG_ERROR(FORMAT, ## ARGS); } while(0)
68 
69 #define logFatal(FORMAT, ARGS...) do { \
70  console_bridge_deprecated(); \
71  LOG_FATAL(FORMAT, ## ARGS); } while(0)
72 
73 #define logInform(FORMAT, ARGS...) do { \
74  console_bridge_deprecated(); \
75  LOG_INFO(FORMAT, ## ARGS); } while(0)
76 
77 
81 namespace console_bridge
82 {
85  {
91  };
92 
93 
96 inline void setLogLevel(LogLevel level)
97 {
98  CONSOLE_BRIDGE_logWarn("The rock implementation of console_bridge does not support setLogLevel()!");
99 }
100 
103 inline LogLevel getLogLevel(void)
104 {
105  CONSOLE_BRIDGE_logWarn("The rock implementation of console_bridge does not support getLogLevel()!");
107 }
108 
109 } // namespace console_bridge
110 
111 #endif
#define CONSOLE_BRIDGE_logWarn(fmt,...)
Definition: console.h:43
LogLevel getLogLevel(void)
Retrieve the current level of logging data. Messages with lower logging levels will not be recorded...
Definition: console.h:103
#define CONSOLE_BRIDGE_DEPRECATED
Definition: console.h:13
void setLogLevel(LogLevel level)
Set the minimum level of logging data to output. Messages with lower logging levels will not be recor...
Definition: console.h:96
LogLevel
The set of priorities for message logging.
Definition: console.h:84
Message namespace. This contains classes needed to output error messages (or logging) from within the...
Definition: console.h:81