log: Allow runtime selection of 'debug' log level
[petitboot] / discover / udev.c
index 7db36a7de5f3777428951f9312c0c78de0b62b8a..9e1a5ce8a5155294efe33b5ee817853c3c57fc43 100644 (file)
@@ -263,23 +263,18 @@ static int udev_handle_dev_change(struct pb_udev *udev, struct udev_device *dev)
 static int udev_handle_dev_action(struct udev_device *dev, const char *action)
 {
        struct pb_udev *udev = udev_get_userdata(udev_device_get_udev(dev));
+       struct udev_list_entry *list;
+       const char *name;
 
-#ifdef DEBUG
-       {
-               struct udev_list_entry *list;
-               const char *name;
-
-               list = udev_device_get_properties_list_entry(dev);
-               name = udev_device_get_sysname(dev);
+       list = udev_device_get_properties_list_entry(dev);
+       name = udev_device_get_sysname(dev);
 
-               pb_debug("%s: action %s, device %s\n", __func__, action, name);
-               pb_debug("%s properties:\n", __func__);
+       pb_debug("udev: action %s, device %s\n", action, name);
+       pb_debug("udev: properties:\n");
 
-               for (; list; list = udev_list_entry_get_next(list))
-                       pb_log("\t%-20s: %s\n", udev_list_entry_get_name(list),
-                                       udev_list_entry_get_value(list));
-       } while (0);
-#endif
+       for (; list; list = udev_list_entry_get_next(list))
+               pb_debug("\t%-20s: %s\n", udev_list_entry_get_name(list),
+                               udev_list_entry_get_value(list));
 
        if (!strcmp(action, "add"))
                return udev_handle_dev_add(udev, dev);