Before this change, the loglevel check would only be performed for the
default log handler in libsigrokdecode, but not for other handlers set
via srd_log_callback_set().
This fixes bug #698.
/* This specific log callback doesn't need the void pointer data. */
(void)cb_data;
- /* Only output messages of at least the selected loglevel(s). */
- if (loglevel > cur_loglevel)
- return SRD_OK;
+ (void)loglevel;
if (fputs("srd: ", stderr) < 0
|| g_vfprintf(stderr, format, args) < 0
int ret;
va_list args;
+ /* Only output messages of at least the selected loglevel(s). */
+ if (loglevel > cur_loglevel)
+ return SRD_OK;
+
va_start(args, format);
ret = srd_log_cb(srd_log_cb_data, loglevel, format, args);
va_end(args);