summaryrefslogtreecommitdiff
path: root/src/scsi_id
diff options
context:
space:
mode:
Diffstat (limited to 'src/scsi_id')
-rw-r--r--src/scsi_id/scsi_id.c12
-rw-r--r--src/scsi_id/scsi_serial.c1
2 files changed, 7 insertions, 6 deletions
diff --git a/src/scsi_id/scsi_id.c b/src/scsi_id/scsi_id.c
index 0ff95e566f..ad190552f7 100644
--- a/src/scsi_id/scsi_id.c
+++ b/src/scsi_id/scsi_id.c
@@ -29,7 +29,6 @@
#include <fcntl.h>
#include <errno.h>
#include <string.h>
-#include <syslog.h>
#include <ctype.h>
#include <getopt.h>
#include <sys/stat.h>
@@ -59,7 +58,6 @@ static bool dev_specified = false;
static char config_file[MAX_PATH_LEN] = "/etc/scsi_id.config";
static enum page_code default_page_code = PAGE_UNSPECIFIED;
static int sg_version = 4;
-static int debug = 0;
static bool reformat_serial = false;
static bool export = false;
static char vendor_str[64];
@@ -74,7 +72,7 @@ static void log_fn(struct udev *udev, int priority,
const char *file, int line, const char *fn,
const char *format, va_list args)
{
- vsyslog(priority, format, args);
+ log_metav(priority, file, line, fn, format, args);
}
static void set_type(const char *from, char *to, size_t len)
@@ -394,7 +392,10 @@ static int set_options(struct udev *udev,
break;
case 'v':
- debug++;
+ log_set_target(LOG_TARGET_CONSOLE);
+ log_set_max_level(LOG_DEBUG);
+ udev_set_log_priority(udev, LOG_DEBUG);
+ log_open();
break;
case 'V':
@@ -587,11 +588,12 @@ int main(int argc, char **argv)
int newargc;
char **newargv = NULL;
+ log_open();
+
udev = udev_new();
if (udev == NULL)
goto exit;
- log_open();
udev_set_log_fn(udev, log_fn);
/*
diff --git a/src/scsi_id/scsi_serial.c b/src/scsi_id/scsi_serial.c
index c3f957db71..1806498503 100644
--- a/src/scsi_id/scsi_serial.c
+++ b/src/scsi_id/scsi_serial.c
@@ -30,7 +30,6 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
-#include <syslog.h>
#include <time.h>
#include <inttypes.h>
#include <scsi/scsi.h>