From 0a03627b5a37825ab29a49fe3bfab9de087a1a43 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 11 Aug 2018 21:59:18 +0200 Subject: [PATCH] SSR MQTT: Minor fixes of logging --- ssr/turris/burrow-ssrd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ssr/turris/burrow-ssrd.c b/ssr/turris/burrow-ssrd.c index 93b1f2c..e0c6c4b 100644 --- a/ssr/turris/burrow-ssrd.c +++ b/ssr/turris/burrow-ssrd.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,7 @@ void open_device(void) libusb_device *dev = devlist[i]; if (!libusb_get_device_descriptor(dev, &desc)) { if (desc.idVendor == 0x4242 && desc.idProduct == 0x0002) { - msg(L_INFO, "Found SSR module at usb%d.%d\n", libusb_get_bus_number(dev), libusb_get_device_address(dev)); + msg(L_INFO, "Found SSR module at usb%d.%d", libusb_get_bus_number(dev), libusb_get_device_address(dev)); if (err = libusb_open(dev, &devh)) die("Cannot open device: error %d", err); @@ -180,10 +181,11 @@ static struct opt_section options = { int main(int argc UNUSED, char **argv) { + log_init(argv[0]); opt_parse(&options, argv+1); if (use_daemon) { - struct log_stream *ls = log_new_syslog("daemon", 0); + struct log_stream *ls = log_new_syslog("daemon", LOG_PID); log_set_default_stream(ls); } if (!use_debug) -- 2.39.2