mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-28 20:58:31 +00:00
Move printing log prefix into a separate function
Reduces code size a bit and makes it cleaner PUBLISHED_FROM=c08064102dc64f59dcdc1f80655f32e1ed94c850
This commit is contained in:
1 parent
fb53cd37e7
commit
482ab33c03
2 files changed
+18
-16
No files matched your search
+6
-5
@@ -646,19 +646,20 @@ void cs_log_set_level(enum cs_log_level level);
|
||||
void cs_log_set_file(FILE *file);
|
||||
|
||||
extern enum cs_log_level cs_log_level;
|
||||
void cs_log_print_prefix(const char *func);
|
||||
void cs_log_printf(const char *fmt, ...);
|
||||
|
||||
#define LOG(l, x) \
|
||||
if (cs_log_level >= l) { \
|
||||
cs_log_printf("%-20s ", __func__); \
|
||||
cs_log_printf x; \
|
||||
#define LOG(l, x) \
|
||||
if (cs_log_level >= l) { \
|
||||
cs_log_print_prefix(__func__); \
|
||||
cs_log_printf x; \
|
||||
}
|
||||
|
||||
#ifndef CS_NDEBUG
|
||||
|
||||
#define DBG(x) \
|
||||
if (cs_log_level >= LL_VERBOSE_DEBUG) { \
|
||||
cs_log_printf("%-20s ", __func__); \
|
||||
cs_log_print_prefix(__func__); \
|
||||
cs_log_printf x; \
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user