Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
KGronek-Pubnub committed Jan 13, 2025
1 parent d8535fd commit 71a64fe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/pubnub_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ enum pubnub_log_level {
#define PUBNUB_LOG_PRINTF(...) printf(__VA_ARGS__)
#endif

/** Generic logging macro, logs to given @a LVL using a printf-like
interface.
*/
#define PUBNUB_LOG(LVL, ...) do { if (LVL <= PUBNUB_LOG_LEVEL) PUBNUB_LOG_PRINTF(__VA_ARGS__); } while(0)

#if PUBNUB_USE_LOG_CALLBACK

Expand All @@ -61,6 +65,7 @@ extern void (*pubnub_log_callback)(enum pubnub_log_level log_level, const char*

void log_with_callback(enum pubnub_log_level log_level, const char* format, ...);

//Redefine this macro to include callback functionality
/** Generic logging macro, logs to given @a LVL using a printf-like
interface. Uses callback instead of printf if pubnub_log_callback
is set.
Expand All @@ -75,11 +80,6 @@ void log_with_callback(enum pubnub_log_level log_level, const char* format, ...)
} \
} \
} while(0)
#else
/** Generic logging macro, logs to given @a LVL using a printf-like
interface.
*/
#define PUBNUB_LOG(LVL, ...) do { if (LVL <= PUBNUB_LOG_LEVEL) PUBNUB_LOG_PRINTF(__VA_ARGS__); } while(0)

#endif /* PUBNUB_USE_LOG_CALLBACK */

Expand Down

0 comments on commit 71a64fe

Please sign in to comment.