From: Paul Brossier Date: Thu, 22 Sep 2016 20:34:00 +0000 (+0200) Subject: src/aubio_priv.h: use new logging function X-Git-Tag: 0.4.4~209 X-Git-Url: https://git.aubio.org/?p=aubio.git;a=commitdiff_plain;h=f5be115791cb250fc5ced51f335ca639d79ab5e8 src/aubio_priv.h: use new logging function --- diff --git a/src/aubio_priv.h b/src/aubio_priv.h index ec62928d..e85231e2 100644 --- a/src/aubio_priv.h +++ b/src/aubio_priv.h @@ -172,16 +172,23 @@ typedef enum { AUBIO_FAIL = 1 } aubio_status; +/* Logging */ + +#include "utils/log.h" + +/** internal logging function, defined in utils/log.c */ +uint_t aubio_log(sint_t level, const char_t *fmt, ...); + #ifdef HAVE_C99_VARARGS_MACROS -#define AUBIO_ERR(...) fprintf(stderr, "AUBIO ERROR: " __VA_ARGS__) -#define AUBIO_MSG(...) fprintf(stdout, __VA_ARGS__) -#define AUBIO_DBG(...) fprintf(stderr, __VA_ARGS__) -#define AUBIO_WRN(...) fprintf(stderr, "AUBIO WARNING: " __VA_ARGS__) +#define AUBIO_ERR(...) aubio_log(AUBIO_LOG_ERR, "AUBIO ERROR: " __VA_ARGS__) +#define AUBIO_MSG(...) aubio_log(AUBIO_LOG_MSG, __VA_ARGS__) +#define AUBIO_DBG(...) aubio_log(AUBIO_LOG_DBG, __VA_ARGS__) +#define AUBIO_WRN(...) aubio_log(AUBIO_LOG_WRN, "AUBIO WARNING: " __VA_ARGS__) #else -#define AUBIO_ERR(format, args...) fprintf(stderr, "AUBIO ERROR: " format , ##args) -#define AUBIO_MSG(format, args...) fprintf(stdout, format , ##args) -#define AUBIO_DBG(format, args...) fprintf(stderr, format , ##args) -#define AUBIO_WRN(format, args...) fprintf(stderr, "AUBIO WARNING: " format, ##args) +#define AUBIO_ERR(format, args...) aubio_log(stderr, "AUBIO ERROR: " format , ##args) +#define AUBIO_MSG(format, args...) aubio_log(stdout, format , ##args) +#define AUBIO_DBG(format, args...) aubio_log(stderr, format , ##args) +#define AUBIO_WRN(format, args...) aubio_log(stderr, "AUBIO WARNING: " format, ##args) #endif #define AUBIO_ERROR AUBIO_ERR