mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 15:40:21 +00:00
MSG(): check log_level early
Improve MSG() in a way that LOG() is - check the log_level first and if not printed, just skip. Previously the eventual arguments were evaluated and also log_msg() was called (althoug exitted immediately).
This commit is contained in:
@@ -94,7 +94,8 @@ void log_msg(int log_level, const char *format, ...) __attribute__((format (prin
|
||||
void log_msg_once(int log_level, uint32_t id, const char *msg, ...) __attribute__((format (printf, 3, 4)));
|
||||
void log_perror(int log_level, const char *msg);
|
||||
#define MSG(l, fmt, ...) \
|
||||
log_msg(LOG_LEVEL_##l, "%s" fmt, MOD_NAME, ##__VA_ARGS__)
|
||||
if (log_level >= LOG_LEVEL_##l) \
|
||||
log_msg(LOG_LEVEL_##l, "%s" fmt, MOD_NAME, ##__VA_ARGS__)
|
||||
|
||||
bool parse_log_cfg(const char *conf_str,
|
||||
int *log_lvl,
|
||||
|
||||
Reference in New Issue
Block a user