chiark / gitweb /
volume_id: provide a custom debug function
[elogind.git] / extras / volume_id / libvolume_id / util.h
index 8cb1abd360046b896a7e5e285e24734119085c99..1d1b53bb5753043800f49bcf19e3400cae6521d7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * volume_id - reads filesystem label and uuid
  *
- * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2005-2006 Kay Sievers <kay.sievers@vrfy.org>
  *
  *     This program is free software; you can redistribute it and/or modify it
  *     under the terms of the GNU General Public License as published by the
 
 #include <endian.h>
 #include <byteswap.h>
+#include <syslog.h>
+
+#define err(format, arg...)    volume_id_log(LOG_ERR, __FILE__, __LINE__, format, ##arg)
+#define info(format, arg...)   volume_id_log(LOG_INFO, __FILE__, __LINE__, format, ##arg)
+#ifdef DEBUG
+#define dbg(format, arg...)    volume_id_log(LOG_DEBUG, __FILE__, __LINE__, format, ##arg)
+#else
+#define dbg(format, arg...)    do { } while (0)
+#endif
 
 /* size of superblock buffer, reiserfs block is at 64k */
 #define SB_BUFFER_SIZE                         0x11000