mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Merge branch 'develop' of git.rwth-aachen.de:acs/public/villas/VILLASnode into develop
This commit is contained in:
commit
bde7dd69d7
1 changed files with 11 additions and 5 deletions
16
lib/log.c
16
lib/log.c
|
@ -304,12 +304,14 @@ void log_vprint(struct log *l, const char *lvl, const char *fmt, va_list ap)
|
|||
/* Timestamp & Severity */
|
||||
strcatf(&buf, "%10.3f %-5s ", time_delta(&l->epoch, &ts), lvl);
|
||||
|
||||
/* Indention */
|
||||
/* Indention in case we log to the terminal */
|
||||
#ifdef __GNUC__
|
||||
for (int i = 0; i < indent; i++)
|
||||
strcatf(&buf, "%s ", BOX_UD);
|
||||
if (l->file == stderr || l->file == stdout) {
|
||||
for (int i = 0; i < indent; i++)
|
||||
strcatf(&buf, "%s ", BOX_UD);
|
||||
|
||||
strcatf(&buf, "%s ", BOX_UDR);
|
||||
strcatf(&buf, "%s ", BOX_UDR);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Format String */
|
||||
|
@ -319,7 +321,11 @@ void log_vprint(struct log *l, const char *lvl, const char *fmt, va_list ap)
|
|||
#ifdef ENABLE_OPAL_ASYNC
|
||||
OpalPrint("VILLASnode: %s\n", buf);
|
||||
#endif
|
||||
fprintf(l->file ? l->file : stderr, "%s\n", buf);
|
||||
if (l->file)
|
||||
fprintf(l->file, "%s\n", buf);
|
||||
|
||||
if (l->syslog)
|
||||
vsyslog(LOG_INFO, fmt, ap);
|
||||
|
||||
free(buf);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue