/* Use global logger */
#define LGDFT NULL
#if LOG_LEVEL >= LOG_LEVEL_ERROR
#define LOG_ERR(logger,tag,text...) \
do { \
Logger::getInstance()->**ut(logger, \
Logger::getInstance()->logFmt( \
"ERR ", tag, __FILE__, __LINE__, text)); \
} while(0)
#else
#define LOG_ERR(logger,tag,text...) do {} while(0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_WARNING
#define LOG_WARN(logger,tag,text...) \
do { \
Logger::getInstance()->**ut(logger, \
Logger::getInstance()->logFmt( \
"WARN ", tag, __FILE__, __LINE__, text)); \
} while(0)
#else
#define LOG_WARN(tag,text...) do {} while(0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_DEBUG
#define LOG_DBG(logger,tag,text...) \
do { \
Logger::getInstance()->**ut(logger, \
Logger::getInstance()->logFmt( \
"DBG ", tag, __FILE__, __LINE__, text)); \
} while(0)
#else
#define LOG_DBG(tag,text...) do {} while(0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_INFO
#define LOG_INF(logger,tag,text...) \
do { \
Logger::getInstance()->**ut(logger, \
Logger::getInstance()->logFmt( \
"INFO ", tag, __FILE__, __LINE__, text)); \
} while(0)
#else
#define LOG_INF(tag,text...) do {} while(0)
#endif
这个管用不? |