diff options
author | nicm <nicm> | 2015-08-28 12:15:54 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-08-28 12:15:54 +0000 |
commit | 18d4802a7bcfc08948dccfd9084144b043ac591b (patch) | |
tree | 099eb89a56568c080edca9835222d90ddf0625e4 | |
parent | b6618b631b783f652ca06c9669b20e40ef30e336 (diff) |
Log time with message.
-rw-r--r-- | log.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |