Check log_put() printf-like format
Thanks to Romain Tartière for the patch http://groups.google.com/group/libnfc-devel/browse_thread/thread/da352d67e6965851
This commit is contained in:
parent
d28889c696
commit
eb1e6d0cb4
1 changed files with 15 additions and 1 deletions
16
libnfc/log.h
16
libnfc/log.h
|
@ -23,11 +23,25 @@
|
||||||
#endif // HAVE_CONFIG_H
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#if defined DEBUG
|
#if defined DEBUG
|
||||||
|
|
||||||
|
# ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if __has_attribute(format) || defined(__GNUC__)
|
||||||
|
# define __has_attribute_format 1
|
||||||
|
# endif
|
||||||
|
|
||||||
// User want debug features
|
// User want debug features
|
||||||
#define LOGGING 1
|
#define LOGGING 1
|
||||||
int log_init (void);
|
int log_init (void);
|
||||||
int log_fini (void);
|
int log_fini (void);
|
||||||
void log_put (const char *category, const char *priority, const char *format, ...);
|
void log_put (const char *category, const char *priority, const char *format, ...)
|
||||||
|
# if __has_attribute_format
|
||||||
|
__attribute__((format(printf, 3, 4)))
|
||||||
|
# endif
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
#define NFC_PRIORITY_FATAL "fatal"
|
#define NFC_PRIORITY_FATAL "fatal"
|
||||||
#define NFC_PRIORITY_ALERT "alert"
|
#define NFC_PRIORITY_ALERT "alert"
|
||||||
|
|
Loading…
Add table
Reference in a new issue