mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Clean macros
This commit is contained in:
parent
dc13700094
commit
01583ef540
@ -309,7 +309,6 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
|||||||
// SPDLOG_LEVEL_OFF
|
// SPDLOG_LEVEL_OFF
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
||||||
#define SPDLOG_LOGGER_TRACE(logger, ...) logger->log(spdlog::source_loc{__FILE__, __LINE__}, spdlog::level::trace, __VA_ARGS__)
|
#define SPDLOG_LOGGER_TRACE(logger, ...) logger->log(spdlog::source_loc{__FILE__, __LINE__}, spdlog::level::trace, __VA_ARGS__)
|
||||||
#define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
|
#define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
|
||||||
@ -318,10 +317,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
|||||||
#define SPDLOG_TRACE(...) (void)0
|
#define SPDLOG_TRACE(...) (void)0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SPDLOG_LOGGER_LOG(logger, level, ...) logger->log(level, __VA_ARGS__)
|
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_DEBUG
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_DEBUG
|
||||||
#define SPDLOG_LOGGER_DEBUG(logger, ...) SPDLOG_LOGGER_LOG(logger, spdlog::level::debug, __VA_ARGS__)
|
#define SPDLOG_LOGGER_DEBUG(logger, ...) logger->log(spdlog::level::debug, __VA_ARGS__)
|
||||||
#define SPDLOG_DEBUG(...) SPDLOG_LOGGER_DEBUG(spdlog::default_logger_raw(), __VA_ARGS__)
|
#define SPDLOG_DEBUG(...) SPDLOG_LOGGER_DEBUG(spdlog::default_logger_raw(), __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define SPDLOG_LOGGER_DEBUG(logger, ...) (void)0
|
#define SPDLOG_LOGGER_DEBUG(logger, ...) (void)0
|
||||||
@ -329,7 +326,7 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_INFO
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_INFO
|
||||||
#define SPDLOG_LOGGER_INFO(logger, ...) SPDLOG_LOGGER_LOG(logger, spdlog::level::info, __VA_ARGS__)
|
#define SPDLOG_LOGGER_INFO(logger, ...) logger->log(spdlog::level::info, __VA_ARGS__)
|
||||||
#define SPDLOG_INFO(...) SPDLOG_LOGGER_INFO(spdlog::default_logger_raw(), __VA_ARGS__)
|
#define SPDLOG_INFO(...) SPDLOG_LOGGER_INFO(spdlog::default_logger_raw(), __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define SPDLOG_LOGGER_INFO(logger, ...) (void)0
|
#define SPDLOG_LOGGER_INFO(logger, ...) (void)0
|
||||||
@ -337,15 +334,15 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_WARN
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_WARN
|
||||||
#define SPDLOG_LOGGER_WARN(logger, ...) SPDLOG_LOGGER_LOG(logger, spdlog::level::warn, __VA_ARGS__)
|
#define SPDLOG_LOGGER_WARN(logger, ...) logger->log(spdlog::level::warn, __VA_ARGS__)
|
||||||
#define SPDLOG_WARN(...) SPDLOG_ACTIVE_LEVEL(spdlog::default_logger_raw(), __VA_ARGS__)
|
#define SPDLOG_WARN(...) SPDLOG_LOGGER_WARN(spdlog::default_logger_raw(), __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define SPDLOG_LOGGER_WARN(logger, ...) (void)0
|
#define SPDLOG_LOGGER_WARN(logger, ...) (void)0
|
||||||
#define SPDLOG_WARN(...) (void)0
|
#define SPDLOG_WARN(...) (void)0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_ERROR
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_ERROR
|
||||||
#define SPDLOG_LOGGER_ERROR(logger, ...) SPDLOG_LOGGER_LOG(logger, spdlog::level::err, __VA_ARGS__)
|
#define SPDLOG_LOGGER_ERROR(logger, ...) logger->log(spdlog::level::err, __VA_ARGS__)
|
||||||
#define SPDLOG_ERROR(...) SPDLOG_LOGGER_ERROR(spdlog::default_logger_raw(), __VA_ARGS__)
|
#define SPDLOG_ERROR(...) SPDLOG_LOGGER_ERROR(spdlog::default_logger_raw(), __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define SPDLOG_LOGGER_ERROR(logger, ...) (void)0
|
#define SPDLOG_LOGGER_ERROR(logger, ...) (void)0
|
||||||
@ -353,7 +350,7 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_CRITICAL
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_CRITICAL
|
||||||
#define SPDLOG_LOGGER_CRITICAL(logger, ...) SPDLOG_LOGGER_LOG(logger, spdlog::level::critical, __VA_ARGS__)
|
#define SPDLOG_LOGGER_CRITICAL(logger, ...) logger->log(spdlog::level::critical, __VA_ARGS__)
|
||||||
#define SPDLOG_CRITICAL(...) SPDLOG_LOGGER_CRITICAL(spdlog::default_logger_raw(), __VA_ARGS__)
|
#define SPDLOG_CRITICAL(...) SPDLOG_LOGGER_CRITICAL(spdlog::default_logger_raw(), __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define SPDLOG_LOGGER_CRITICAL(logger, ...) (void)0
|
#define SPDLOG_LOGGER_CRITICAL(logger, ...) (void)0
|
||||||
|
Loading…
Reference in New Issue
Block a user