#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
+/** @cond PRIVATE */
#define LOG_PREFIX "log"
+/** @endcond */
/**
* @file
/* 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 SR_OK;
+ (void)loglevel;
if (cur_loglevel >= LOGLEVEL_TIMESTAMP) {
elapsed_us = g_get_monotonic_time() - sr_log_start_time;
}
g_fprintf(stderr, "%s\n", output);
+ fflush(stderr);
g_free(raw_output);
g_free(output);
int ret;
va_list args;
+ /* Only output messages of at least the selected loglevel(s). */
+ if (loglevel > cur_loglevel)
+ return SR_OK;
+
va_start(args, format);
ret = sr_log_cb(sr_log_cb_data, loglevel, format, args);
va_end(args);