diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-05-13 14:31:20 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-05-13 14:31:20 +0000 |
commit | bb4c595810ccd9b849be2d20f5c16d6076d083bb (patch) | |
tree | a0443629b2d996f0597f75e8bafee3f8fd13505e /src/htsbase.h | |
parent | 84c47b0ce10547fdf223f721ef88f7af09af5401 (diff) |
Introducing the hts_log_print() logging function
* cleaned up logging
Diffstat (limited to 'src/htsbase.h')
-rw-r--r-- | src/htsbase.h | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/src/htsbase.h b/src/htsbase.h index e144991..ef01eba 100644 --- a/src/htsbase.h +++ b/src/htsbase.h @@ -71,9 +71,11 @@ extern "C" { #ifdef __GNUC__ #define HTS_UNUSED __attribute__ ((unused)) #define HTS_STATIC static __attribute__ ((unused)) +#define HTS_PRINTF_FUN(fmt, arg) __attribute__ ((format (printf, fmt, arg))) #else #define HTS_UNUSED #define HTS_STATIC static +#define HTS_PRINTF_FUN(fmt, arg) #endif #endif @@ -156,36 +158,6 @@ extern HTSEXT_API t_abortLog abortLog__; } \ } while(0) -/* logging */ -typedef enum { - LOG_DEBUG, - LOG_INFO, - LOG_WARNING, - LOG_ERROR, - LOG_PANIC -} HTS_LogType; -#define HTS_LOG(OPT,TYPE) do { \ - int last_errno = errno; \ - switch(TYPE) { \ - case LOG_DEBUG: \ - fspc(OPT,(OPT)->log, "debug"); \ - break; \ - case LOG_INFO: \ - fspc(OPT,(OPT)->log, "info"); \ - break; \ - case LOG_WARNING: \ - fspc(OPT,(OPT)->log, "warning"); \ - break; \ - case LOG_ERROR: \ - fspc(OPT,(OPT)->log, "error"); \ - break; \ - case LOG_PANIC: \ - fspc(OPT,(OPT)->log, "panic"); \ - break; \ - } \ - errno = last_errno; \ -} while(0) - /* regular malloc's() */ #ifndef HTS_TRACE_MALLOC #define malloct(A) malloc(A) |