chiark / gitweb /
[PATCH] make libsysfs spit debug messages to the same place as the rest of udev.
[elogind.git] / libsysfs / sysfs.h
index 00599954fd757332ce4ba8793429fe3b51e1fd11..e39b7413cbb91d5759988e25111f2fd68cb1da4d 100644 (file)
@@ -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_ */