1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-05 23:58:58 +00:00

Log time with message.

This commit is contained in:
nicm 2015-08-28 12:15:54 +00:00
parent b6618b631b
commit 18d4802a7b

4
log.c
View File

@ -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);