summaryrefslogtreecommitdiffstats
path: root/sysdep/unix/log.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-02-03 00:19:24 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-02-03 00:19:24 +0100
commitc37e78510f2ac4d9bb4c44eddf33352eda72fd0f (patch)
tree82153f7a851aeeaf6999ee59b3bd18ebbc761254 /sysdep/unix/log.c
parent44f26560ec9f108039e6736d6de929f899bf20ea (diff)
downloadbird-c37e78510f2ac4d9bb4c44eddf33352eda72fd0f.tar
bird-c37e78510f2ac4d9bb4c44eddf33352eda72fd0f.zip
Makes date/time formats configurable.
Diffstat (limited to 'sysdep/unix/log.c')
-rw-r--r--sysdep/unix/log.c14
1 files changed, 3 insertions, 11 deletions
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);