From fb308a4f7db1edeb524be691598f9d3f48dbabb6 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Tue, 13 Mar 2012 01:36:38 +0000 Subject: modbuslog: Surround syslog outputs with brackets --- src/modbuslog.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modbuslog.c b/src/modbuslog.c index 5142646..3b56290 100644 --- a/src/modbuslog.c +++ b/src/modbuslog.c @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) { openlog("modbuslog", SYSLOG_CONSOLE_OUTPUT | LOG_PID | LOG_CONS, LOG_USER); syslog(LOG_INFO, ""); - syslog(LOG_INFO, "modbuslog %s starting", VERSION_STRING); + syslog(LOG_INFO, "modbuslog [%s] starting", VERSION_STRING); syslog(LOG_INFO, ""); const char *configfile = "/etc/modbuslog.cfg"; @@ -222,7 +222,7 @@ int main(int argc, char *argv[]) { } if (modbus_connect(ctx) == -1) { - syslog(LOG_ERR, "libmodbus: Connection failed: %s", + syslog(LOG_ERR, "libmodbus: Connection failed: [%s]", modbus_strerror(errno)); modbus_free(ctx); } @@ -249,7 +249,7 @@ int main(int argc, char *argv[]) { break; } if (rc == -1) { - syslog(LOG_ERR, "libmodbus error: %s", + syslog(LOG_ERR, "libmodbus error: [%s]", modbus_strerror(errno)); } retry++; @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) { } else { // file doesn't exist. create it. syslog(LOG_NOTICE, "logfile does not exist"); - syslog(LOG_INFO, "creating file: %s", log_filename); + syslog(LOG_INFO, "creating file: [%s]", log_filename); FILE *fp = fopen(log_filename, "w"); fprintf( fp, @@ -291,7 +291,7 @@ int main(int argc, char *argv[]) { FILE *filehandle = fopen(log_filename, "a+"); - syslog(LOG_DEBUG, "opening file for append: %s", log_filename); + syslog(LOG_DEBUG, "opening file for append: [%s]", log_filename); int16_t registervalue = 0; @@ -328,7 +328,7 @@ int main(int argc, char *argv[]) { sprintf(interval_filename, "/var/modbuslog/interval/interval.txt"); - syslog(LOG_DEBUG, "opening interval file: %s", + syslog(LOG_DEBUG, "opening interval file: [%s]", interval_filename); FILE *intervalfile = fopen(interval_filename, "r+"); @@ -338,7 +338,7 @@ int main(int argc, char *argv[]) { } else { // file doesn't exist. create it. syslog(LOG_NOTICE, "interval file does not exist"); - syslog(LOG_INFO, "attempting to create file: %s", + syslog(LOG_INFO, "attempting to create file: [%s]", interval_filename); intervalfile = fopen(interval_filename, "w"); fprintf(intervalfile, "0\n"); @@ -371,7 +371,7 @@ int main(int argc, char *argv[]) { syslog( LOG_DEBUG, - "%i|%04i%02i%02i|%02i%02i%02i|%04i%02i%02i|%02i%02i%02i|%i|%i|%i\n", + "[%i|%04i%02i%02i|%02i%02i%02i|%04i%02i%02i|%02i%02i%02i|%i|%i|%i]\n", intervalid, utc.tm_year + 1900, utc.tm_mon + 1, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec, lc.tm_year + 1900, lc.tm_mon + 1, lc.tm_mday, -- cgit v1.2.3 2024-01-30 17:34:57 +0100'>2024-01-30dvb-s: drop transponders that aren't there at Lyngsat anymoreMauro Carvalho Chehab50-20357/+0 2024-01-30dvb-s: update from today's Lyngsat reportMauro Carvalho Chehab196-15543/+15859 2024-01-30dtv-scan-tables: full uk transmitter updateSimon Liddicott81-500/+163 2022-11-25dtv-scan-tables: hu-Digikabel changesHrotkó Gábor1-1/+26 2022-04-30pt-All: fix modulationMauro Carvalho Chehab1-10/+10 2022-04-30pt-All: Update Portugal channelsMauro Carvalho Chehab1-34/+70 2022-03-07Update Brazilian ISDB-T tablesMauro Carvalho Chehab549-2923/+13860 2022-03-07Update satellite channel lists from LyngsatMauro Carvalho Chehab54-1882/+2326 2021-12-14dtv-scan-tables: latest UK changesSimon Liddicott4-24/+24 2021-04-30update Brazilian scan filesMauro Carvalho Chehab2476-12805/+69312 2021-04-30Remove legacy entriesMauro Carvalho Chehab129-24898/+0 2021-04-30Add new satellites from LyngsatMauro Carvalho Chehab75-21/+29721 2021-04-30Rename a few satellites with two names and update frequenciesMauro Carvalho Chehab2-283/+182 2021-04-30Update frequencies from LyngsatMauro Carvalho Chehab188-12304/+12666