summaryrefslogtreecommitdiff
path: root/recipes-support/uxfp/uxfp-from-source/0002-uxfp-add-param-syslog.patch
blob: 8dedc1b06356cc948f13c9748f4b8c44cd08122c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

The patch allows to redirect all log messages from stdout to syslog.

diff -ruN git/uxfp/main.c git/uxfp/main.c
--- git/uxfp/main.c	2020-07-28 19:06:02.236397898 +0300
+++ git/uxfp/main.c	2020-07-28 17:55:38.000000000 +0300
@@ -20,6 +20,7 @@
     uint64_t speed;
     bool     debug;
     bool     recovery;
+    bool     syslog;
 } options = {0};
 
 flag_t flags [] = {
@@ -30,6 +31,7 @@
     {"--class",        "-c", VALUE_TYPE_ULONG,   &options.class,    OPT, "modem class"},
     {"--debug",        "-d", VALUE_TYPE_BOOLEAN, &options.debug,    OPT, "enable debug logging"},
     {"--lossrecovery", "-l", VALUE_TYPE_BOOLEAN, &options.recovery, OPT, "device in recovery mode"},
+    {"--syslog",       "-n", VALUE_TYPE_BOOLEAN, &options.syslog,   OPT, "all the logs redirected to syslog"},
     {NULL,             NULL, VALUE_TYPE_UNKNOWN, NULL,              OPT, NULL},
 };
 
@@ -60,6 +62,10 @@
         goto end;
     }
 
+    if (options.syslog) {
+        core_log_set_native(true);
+    }
+
     if (options.debug) {
         core_log_set_level(LOG_LEVEL_DBG);
     }