10 #ifndef INCLUDED_SAL_DETAIL_LOG_H
11 #define INCLUDED_SAL_DETAIL_LOG_H
38 #if defined __cplusplus
46 #if defined __cplusplus
47 #define SAL_LOG_TRUE true
48 #define SAL_LOG_FALSE false
50 #define SAL_LOG_TRUE sal_True
51 #define SAL_LOG_FALSE sal_False
54 enum sal_detail_LogLevel {
55 SAL_DETAIL_LOG_LEVEL_INFO, SAL_DETAIL_LOG_LEVEL_WARN,
56 SAL_DETAIL_LOG_LEVEL_DEBUG = SAL_MAX_ENUM
60 enum sal_detail_LogLevel level,
char const * area,
char const * where,
61 char const * format, ...)
63 #if defined __GNUC__ && 0
64 __attribute__((format(printf, 4, 5)))
68 #if defined __cplusplus
72 #define SAL_DETAIL_LOG_FORMAT(condition, level, area, where, ...) \
75 sal_detail_logFormat((level), (area), (where), __VA_ARGS__); \
77 } while (SAL_LOG_FALSE)
79 #if defined SAL_LOG_INFO
80 #define SAL_DETAIL_ENABLE_LOG_INFO SAL_LOG_TRUE
82 #define SAL_DETAIL_ENABLE_LOG_INFO SAL_LOG_FALSE
84 #if defined SAL_LOG_WARN
85 #define SAL_DETAIL_ENABLE_LOG_WARN SAL_LOG_TRUE
87 #define SAL_DETAIL_ENABLE_LOG_WARN SAL_LOG_FALSE
90 #define SAL_DETAIL_WHERE __FILE__ ":" SAL_STRINGIFY(__LINE__) ": "
92 #define SAL_DETAIL_INFO_IF_FORMAT(condition, area, ...) \
93 SAL_DETAIL_LOG_FORMAT( \
94 SAL_DETAIL_ENABLE_LOG_INFO && (condition), SAL_DETAIL_LOG_LEVEL_INFO, \
95 area, SAL_DETAIL_WHERE, __VA_ARGS__)
97 #define SAL_DETAIL_WARN_IF_FORMAT(condition, area, ...) \
98 SAL_DETAIL_LOG_FORMAT( \
99 SAL_DETAIL_ENABLE_LOG_WARN && (condition), SAL_DETAIL_LOG_LEVEL_WARN, \
100 area, SAL_DETAIL_WHERE, __VA_ARGS__)
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30