From c37e78510f2ac4d9bb4c44eddf33352eda72fd0f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 3 Feb 2010 00:19:24 +0100 Subject: Makes date/time formats configurable. --- sysdep/unix/log.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'sysdep/unix/log.c') diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index dad0c5d..f227549 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -79,21 +79,13 @@ vlog(int class, char *msg, va_list args) continue; if (l->fh) { - time_t now = time(NULL); - struct tm *tm = localtime(&now); - if (l->terminal_flag) fputs("bird: ", l->fh); else { - fprintf(l->fh, "%02d-%02d-%04d %02d:%02d:%02d <%s> ", - tm->tm_mday, - tm->tm_mon+1, - tm->tm_year+1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec, - class_names[class]); + byte tbuf[TM_DATETIME_BUFFER_SIZE]; + tm_format_datetime(tbuf, &config->tf_log, now); + fprintf(l->fh, "%s <%s> ", tbuf, class_names[class]); } fputs(buf, l->fh); fputc('\n', l->fh); -- cgit v1.2.3