From 54988802b795328ceba29480611102902e88f572 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Thu, 15 Jan 2004 21:53:20 -0800 Subject: [PATCH] add udev logging to info log On Thu, Jan 15, 2004 at 05:14:16AM +0100, Kay Sievers wrote: > On Wed, Jan 14, 2004 at 01:10:43PM -0800, Greg KH wrote: > > On Wed, Jan 14, 2004 at 02:34:26PM -0600, Clay Haapala wrote: > > > On Wed, 14 Jan 2004, Chris Friesen spake thusly: > > > > > > > > Maybe for ones with a matching rule, you could print something like: > > > > > > > > > > > Is the act of printing/syslogging a rule in an of itself? > > > > No, as currently the only way stuff ends up in the syslog is if > > DEBUG=true is used on the build line. > > > > But it's sounding like we might want to change that... :) > > How about this in the syslog after connect/disconnect? > > Jan 15 05:07:45 pim udev[28007]: configured rule in '/etc/udev/udev.rules' at line 17 applied, 'video*' becomes 'video/webcam%n' > Jan 15 05:07:45 pim udev[28007]: creating device node '/udev/video/webcam0' > Jan 15 05:07:47 pim udev[28015]: removing device node '/udev/video/webcam0' Here is a slightly better version. I've created a logging.h file and moved the debug macros from udev.h in there. If you type: 'make' - you will get a binary that prints one or two lines to syslog if a device node is created or deleted 'make LOG=false' - you get a binary that prints asolutely nothing 'make DEBUG=true' - the same as today, it will print all debug lines --- namedev_parse.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'namedev_parse.c') diff --git a/namedev_parse.c b/namedev_parse.c index 0712c3b447..a17c02e395 100644 --- a/namedev_parse.c +++ b/namedev_parse.c @@ -36,6 +36,7 @@ #include #include "udev.h" +#include "logging.h" #include "namedev.h" static int add_config_dev(struct config_device *new_dev) @@ -249,6 +250,7 @@ int namedev_init_rules(void) goto error; } + dev.config_line = lineno; retval = add_config_dev(&dev); if (retval) { dbg("add_config_dev returned with error %d", retval); -- cgit v1.2.3-54-g00ecf