parent
295ed0aa62
commit
0e6fef12c2
|
@ -34,9 +34,9 @@
|
|||
|
||||
#if (LOG_LEVEL<=LOG_ERR)
|
||||
#define ELog(tag, ...) printf("[ERR|"#tag "] " __VA_ARGS__)
|
||||
#else // !(LOG_LEVEL<LOG_WAR)
|
||||
#else // !(LOG_LEVEL<LOG_ERR)
|
||||
#define ELog(tag, ...)
|
||||
#endif // (LOG_LEVEL<LOG_WAR)
|
||||
#endif // (LOG_LEVEL<LOG_ERR)
|
||||
```
|
||||
|
||||
## C++ 带类和函数的扩展版
|
||||
|
@ -52,34 +52,34 @@
|
|||
#define LOG_LEVEL LOG_DBG
|
||||
|
||||
#if (LOG_LEVEL<=LOG_DBG)
|
||||
#define DLog0(fmt) printf("[DBG|%s]" fmt, __PRETTY_FUNCTION__)
|
||||
#define DMsg(msg) printf("[DBG|%s]" msg, __PRETTY_FUNCTION__)
|
||||
#define DLog(fmt, ...) printf("[DBG|%s]" fmt, __PRETTY_FUNCTION__, __VA_ARGS__)
|
||||
#else // !(LOG_LEVEL<LOG_DBG)
|
||||
#define DLog0(fmt)
|
||||
#define DMsg(msg)
|
||||
#define DLog(fmt, ...)
|
||||
#endif // (LOG_LEVEL<LOG_DBG)
|
||||
|
||||
#if (LOG_LEVEL<=LOG_INF)
|
||||
#define ILog0(fmt) printf("[INF|%s]" fmt, __PRETTY_FUNCTION__)
|
||||
#define IMsg(msg) printf("[INF|%s]" msg, __PRETTY_FUNCTION__)
|
||||
#define ILog(fmt, ...) printf("[INF|%s]" fmt, __PRETTY_FUNCTION__, __VA_ARGS__)
|
||||
#else // !(LOG_LEVEL<LOG_INF)
|
||||
#define ILog0(fmt)
|
||||
#define IMsg(msg)
|
||||
#define ILog(fmt, ...)
|
||||
#endif // (LOG_LEVEL<LOG_INF)
|
||||
|
||||
#if (LOG_LEVEL<=LOG_WAR)
|
||||
#define WLog0(fmt) printf("[WAR|%s]" fmt, __PRETTY_FUNCTION__)
|
||||
#define WMsg(msg) printf("[WAR|%s]" msg, __PRETTY_FUNCTION__)
|
||||
#define WLog(fmt, ...) printf("[WAR|%s]" fmt, __PRETTY_FUNCTION__, __VA_ARGS__)
|
||||
#else // !(LOG_LEVEL<LOG_WAR)
|
||||
#define WLog0(fmt)
|
||||
#define WMsg(msg)
|
||||
#define WLog(fmt, ...)
|
||||
#endif // (LOG_LEVEL<LOG_WAR)
|
||||
|
||||
#if (LOG_LEVEL<=LOG_ERR)
|
||||
#define ELog0(fmt) printf("[ERR|%s]" fmt, __PRETTY_FUNCTION__)
|
||||
#define EMsg(msg) printf("[ERR|%s]" msg, __PRETTY_FUNCTION__)
|
||||
#define ELog(fmt, ...) printf("[ERR|%s]" fmt, __PRETTY_FUNCTION__, __VA_ARGS__)
|
||||
#else // !(LOG_LEVEL<LOG_WAR)
|
||||
#define ELog0(fmt)
|
||||
#else // !(LOG_LEVEL<LOG_ERR)
|
||||
#define EMsg(msg)
|
||||
#define ELog(fmt, ...)
|
||||
#endif // (LOG_LEVEL<LOG_WAR)
|
||||
#endif // (LOG_LEVEL<LOG_ERR)
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue