summaryrefslogtreecommitdiff
path: root/extras/volume_id/udev_volume_id.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-06-05 05:17:21 +0200
committerKay Sievers <kay.sievers@suse.de>2005-06-05 05:17:21 +0200
commitc2401132bf72cbda6555f1ef4403851c14faeba5 (patch)
tree04d19908e4a0ca958809a5014ea253d34b391ea5 /extras/volume_id/udev_volume_id.c
parent995aec875973e29caf42b037736349fc8839ee40 (diff)
volume_id: use udev-provided log-level
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'extras/volume_id/udev_volume_id.c')
-rw-r--r--extras/volume_id/udev_volume_id.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/extras/volume_id/udev_volume_id.c b/extras/volume_id/udev_volume_id.c
index a00b01a27d..7c6fc4050d 100644
--- a/extras/volume_id/udev_volume_id.c
+++ b/extras/volume_id/udev_volume_id.c
@@ -40,12 +40,26 @@
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
#ifdef USE_LOG
-void log_message(int level, const char *format, ...)
+void log_message(int priority, const char *format, ...)
{
va_list args;
+ static int udev_log = -1;
+
+ if (udev_log == -1) {
+ const char *value;
+
+ value = getenv("UDEV_LOG");
+ if (value)
+ udev_log = log_priority(value);
+ else
+ udev_log = LOG_ERR;
+ }
+
+ if (priority > udev_log)
+ return;
va_start(args, format);
- vsyslog(level, format, args);
+ vsyslog(priority, format, args);
va_end(args);
}
#endif