summaryrefslogtreecommitdiff
path: root/udevstart.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-03-27 00:11:03 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:54:59 -0700
commit6b493a20e1dbf90a4e54d3be37027fa906220c31 (patch)
tree4bceed1a0432468d77b9a0fa4aa5b553dd38f96f /udevstart.c
parent65005a7f81f86590f7f03bd3d4019c485d0e3c77 (diff)
[PATCH] support log-priority levels in udev.conf
Diffstat (limited to 'udevstart.c')
-rw-r--r--udevstart.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/udevstart.c b/udevstart.c
index 7765661fe4..a862dadf88 100644
--- a/udevstart.c
+++ b/udevstart.c
@@ -38,14 +38,23 @@
#include "libsysfs/sysfs/libsysfs.h"
#include "udev_libc_wrapper.h"
#include "udev.h"
+#include "udev_version.h"
#include "logging.h"
#include "udev_rules.h"
#include "udev_utils.h"
#include "list.h"
#ifdef USE_LOG
-void log_message(int level, const char *format, ...)
+void log_message(int priority, const char *format, ...)
{
+ va_list args;
+
+ if (priority > udev_log_priority)
+ return;
+
+ va_start(args, format);
+ vsyslog(priority, format, args);
+ va_end(args);
}
#endif
@@ -299,7 +308,12 @@ int main(int argc, char *argv[], char *envp[])
{
struct sigaction act;
+ logging_init("udev");
udev_init_config();
+ /* disable all logging if not explicitely requested */
+ if (getenv("UDEV_LOG") == NULL)
+ udev_log_priority = 0;
+ dbg("version %s", UDEV_VERSION);
/* set signal handlers */
memset(&act, 0x00, sizeof(act));
@@ -322,5 +336,6 @@ int main(int argc, char *argv[], char *envp[])
udev_scan_block();
udev_scan_class();
+ logging_close();
return 0;
}