Moved logging defines to main logger.

This commit is contained in:
Armin Novak 2014-08-18 19:17:06 +02:00 committed by Armin Novak
parent 7e3a1b3073
commit 6baf98dcda
2 changed files with 15 additions and 31 deletions

View File

@ -277,6 +277,21 @@ extern "C" {
#define WLog_IsLevelActive(_log, _log_level) \
(_log_level >= WLog_GetLogLevel(_log))
#define WLog_LVL(tag, lvl, fmt, ...) WLog_Print(WLog_Get(tag), lvl, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_VRB(tag, fmt, ...) WLog_Print(WLog_Get(tag), WLOG_TRACE, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_DBG(tag, fmt, ...) WLog_Print(WLog_Get(tag), WLOG_DEBUG, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_INFO(tag, fmt, ...) WLog_Print(WLog_Get(tag), WLOG_INFO, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_WARN(tag, fmt, ...) WLog_Print(WLog_Get(tag), WLOG_WARN, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_ERR(tag, fmt, ...) WLog_Print(WLog_Get(tag), WLOG_ERROR, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_FATAL(tag, fmt, ...) WLog_Print(WLog_Get(tag), WLOG_FATAL, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
WINPR_API DWORD WLog_GetLogLevel(wLog *log);
WINPR_API void WLog_SetLogLevel(wLog *log, DWORD logLevel);

View File

@ -24,35 +24,4 @@
#define WINPR_TAG(tag) "com.winpr." tag
#define WLOG_PRINT(level, file, fkt, line, tag, fmt, ...) \
do { \
wLogMessage msg; \
wLog *log; \
\
log = WLog_Get(tag); \
\
msg.Type = WLOG_MESSAGE_TEXT; \
msg.Level = level; \
msg.FormatString = fmt; \
msg.LineNumber = line; \
msg.FileName = file; \
msg.FunctionName = fkt; \
WLog_PrintMessage(log, &msg, ##__VA_ARGS__); \
} while (0 )
#define WLog_LVL(tag, lvl, fmt, ...) WLOG_PRINT(lvl, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_VRB(tag, fmt, ...) WLOG_PRINT(WLOG_TRACE, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_DBG(tag, fmt, ...) WLOG_PRINT(WLOG_DEBUG, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_INFO(tag, fmt, ...) WLOG_PRINT(WLOG_INFO, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_WARN(tag, fmt, ...) WLOG_PRINT(WLOG_WARN, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_ERR(tag, fmt, ...) WLOG_PRINT(WLOG_ERROR, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#define WLog_FATAL(tag, fmt, ...) WLOG_PRINT(WLOG_FATAL, __FILE__, __FUNCTION__, \
__LINE__, tag, fmt, ## __VA_ARGS__)
#endif /* FREERDP_UTILS_DEBUG_H */