summaryrefslogtreecommitdiff
path: root/libsysfs
diff options
context:
space:
mode:
Diffstat (limited to 'libsysfs')
-rw-r--r--libsysfs/sysfs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libsysfs/sysfs.h b/libsysfs/sysfs.h
index 00599954fd..e39b7413cb 100644
--- a/libsysfs/sysfs.h
+++ b/libsysfs/sysfs.h
@@ -41,9 +41,17 @@ extern int isascii(int c);
/* Debugging */
#ifdef DEBUG
-#define dprintf(format, arg...) fprintf(stderr, format, ## arg)
+#include <syslog.h>
+#define dprintf(format, arg...) \
+ do { \
+ log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
+ } while (0)
#else
#define dprintf(format, arg...) do { } while (0)
#endif
+extern int log_message (int level, const char *format, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+
#endif /* _SYSFS_H_ */