@@ -42,8 +42,8 @@ typedef struct logConfig_s {
4242PG_DECLARE (logConfig_t , logConfig );
4343
4444void logInit (void );
45- void _logf (logTopic_e topic , unsigned level , bool synchronous , const char * fmt , ...) __attribute__ ((format (printf , 4 , 5 )));
46- void _logBufferHex (logTopic_e topic , unsigned level , bool synchronous , const void * buffer , size_t size );
45+ void _logf (logTopic_e topic , unsigned level , const char * fmt , ...) __attribute__ ((format (printf , 3 , 4 )));
46+ void _logBufferHex (logTopic_e topic , unsigned level , const void * buffer , size_t size );
4747
4848// LOG_* macro definitions
4949
@@ -52,61 +52,41 @@ void _logBufferHex(logTopic_e topic, unsigned level, bool synchronous, const voi
5252#endif
5353
5454#if defined(USE_LOG ) && LOG_LEVEL_MAXIMUM >= LOG_LEVEL_ERROR
55- #define LOG_E (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_ERROR, false, fmt, ##__VA_ARGS__)
56- #define LOG_E_SYNC (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_ERROR, true, fmt, ##__VA_ARGS__)
57- #define LOG_BUFFER_E (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_ERROR, false, buf, size)
58- #define LOG_BUFFER_E_SYNC (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_ERROR, true, buf, size)
55+ #define LOG_E (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_ERROR, fmt, ##__VA_ARGS__)
56+ #define LOG_BUFFER_E (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_ERROR, buf, size)
5957#else
6058#define LOG_E (...)
61- #define LOG_E_SYNC (...)
6259#define LOG_BUFFER_E (...)
63- #define LOG_BUFFER_E_SYNC (...)
6460#endif
6561
6662#if defined(USE_LOG ) && LOG_LEVEL_MAXIMUM >= LOG_LEVEL_WARNING
67- #define LOG_W (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_WARNING, false, fmt, ##__VA_ARGS__)
68- #define LOG_W_SYNC (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_WARNING, true, fmt, ##__VA_ARGS__)
69- #define LOG_BUF_W (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_WARNING, false, buf, size)
70- #define LOG_BUF_W_SYNC (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_WARNING, true, buf, size)
63+ #define LOG_W (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_WARNING, fmt, ##__VA_ARGS__)
64+ #define LOG_BUF_W (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_WARNING, buf, size)
7165#else
7266#define LOG_W (...)
73- #define LOG_W_SYNC (...)
7467#define LOG_BUF_W (...)
75- #define LOG_BUF_W_SYNC (...)
7668#endif
7769
7870#if defined(USE_LOG ) && LOG_LEVEL_MAXIMUM >= LOG_LEVEL_INFO
79- #define LOG_I (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_INFO, false, fmt, ##__VA_ARGS__)
80- #define LOG_I_SYNC (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_INFO, true, fmt, ##__VA_ARGS__)
81- #define LOG_BUF_I (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_INFO, false, buf, size)
82- #define LOG_BUF_I_SYNC (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_INFO, true, buf, size)
71+ #define LOG_I (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_INFO, fmt, ##__VA_ARGS__)
72+ #define LOG_BUF_I (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_INFO, buf, size)
8373#else
8474#define LOG_I (...)
85- #define LOG_I_SYNC (...)
8675#define LOG_BUF_I (...)
87- #define LOG_BUF_I_SYNC (...)
8876#endif
8977
9078#if defined(USE_LOG ) && LOG_LEVEL_MAXIMUM >= LOG_LEVEL_VERBOSE
91- #define LOG_V (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_VERBOSE, false, fmt, ##__VA_ARGS__)
92- #define LOG_V_SYNC (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_VERBOSE, true, fmt, ##__VA_ARGS__)
93- #define LOG_BUF_V (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_VERBOSE, false, buf, size)
94- #define LOG_BUF_V_SYNC (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_VERBOSE, true, buf, size)
79+ #define LOG_V (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_VERBOSE, fmt, ##__VA_ARGS__)
80+ #define LOG_BUF_V (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_VERBOSE, buf, size)
9581#else
9682#define LOG_V (...)
97- #define LOG_V_SYNC (...)
9883#define LOG_BUF_V (...)
99- #define LOG_BUF_V_SYNC (...)
10084#endif
10185
10286#if defined(USE_LOG ) && LOG_LEVEL_MAXIMUM >= LOG_LEVEL_DEBUG
103- #define LOG_D (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_DEBUG, false, fmt, ##__VA_ARGS__)
104- #define LOG_D_SYNC (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_DEBUG, true, fmt, ##__VA_ARGS__)
105- #define LOG_BUF_D (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_DEBUG, false, buf, size)
106- #define LOG_BUF_D_SYNC (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_DEBUG, true, buf, size)
87+ #define LOG_D (topic , fmt , ...) _logf(LOG_TOPIC_ ## topic, LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__)
88+ #define LOG_BUF_D (topic , buf , size ) _logBufferHex(LOG_TOPIC_ ## topic, LOG_LEVEL_DEBUG, buf, size)
10789#else
10890#define LOG_D (...)
109- #define LOG_D_SYNC (...)
11091#define LOG_BUF_D (...)
111- #define LOG_BUF_D_SYNC (...)
11292#endif
0 commit comments