From 8110c900d24d44ba06fa8f07a463fcf4124e32dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Fri, 30 Dec 2022 10:07:20 +0100 Subject: [PATCH] Option --logfile=syslog now works as expected. --- README.md | 2 +- src/main.cc | 5 +++++ wmbusmeters.1 | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6ea71f8..e59835f 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,7 @@ As {options} you can use: --listmeters list all meter drivers --listmeters= list all meter drivers containing the text --listunits list all unit suffixes that can be used for typing values - --logfile= use this file for logging + --logfile= use this file for logging or --logfile=syslog --logtelegrams log the contents of the telegrams for easy replay --logtimestamps= add log timestamps: always never important --meterfiles= store meter readings in dir diff --git a/src/main.cc b/src/main.cc index 731a99f..009bb9b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -438,6 +438,11 @@ void setup_log_file(Configuration *config) if (config->use_logfile) { verbose("(wmbusmeters) using log file %s\n", config->logfile.c_str()); + if (config->logfile == "syslog") + { + enableSyslog(); + return; + } bool ok = enableLogfile(config->logfile, config->daemon); if (!ok) { if (config->daemon) { diff --git a/wmbusmeters.1 b/wmbusmeters.1 index e2f638a..b27bf04 100644 --- a/wmbusmeters.1 +++ b/wmbusmeters.1 @@ -73,7 +73,7 @@ Add :verbose to any analyze to get more verbose analyze output. \fB\--listunits=\fR list all unit suffixes that can be used for typing values -\fB\--logfile=\fR use this file for logging +\fB\--logfile=\fR use this file for logging or --logfile=syslog \fB\--logtelegrams\fR log the contents of the telegrams for easy replay