summaryrefslogtreecommitdiffstats
path: root/log.c
diff options
context:
space:
mode:
authornicm <nicm>2015-08-28 12:15:54 +0000
committernicm <nicm>2015-08-28 12:15:54 +0000
commit18d4802a7bcfc08948dccfd9084144b043ac591b (patch)
tree099eb89a56568c080edca9835222d90ddf0625e4 /log.c
parentb6618b631b783f652ca06c9669b20e40ef30e336 (diff)
Log time with message.
Diffstat (limited to 'log.c')
-rw-r--r--log.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/log.c b/log.c
index 0f42f66f..9a53775e 100644
--- a/log.c
+++ b/log.c
@@ -67,11 +67,13 @@ void
log_vwrite(const char *msg, va_list ap)
{
char *fmt;
+ time_t t;
if (log_file == NULL)
return;
- if (asprintf(&fmt, "%s\n", msg) == -1)
+ t = time(NULL);
+ if (asprintf(&fmt, "%lld %s\n", (long long)t, msg) == -1)
exit(1);
if (vfprintf(log_file, fmt, ap) == -1)
exit(1);