From c9a9a0ac1ec3b985d38c01ddf9f0ba2f15386f34 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Apr 2022 15:09:23 +0100 Subject: patch 8.2.4742: there is no way to start logging very early in startup Problem: There is no way to start logging very early in startup. Solution: Add the --log argument. Include the date in the start message in the log file. Avoid a duplicate message when forking. Log an executed shell command. --- src/channel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/channel.c') diff --git a/src/channel.c b/src/channel.c index f8a8194374..e971e17c09 100644 --- a/src/channel.c +++ b/src/channel.c @@ -178,7 +178,10 @@ ch_logfile(char_u *fname, char_u *opt) if (log_fd != NULL) { - fprintf(log_fd, "==== start log session ====\n"); + fprintf(log_fd, "==== start log session %s ====\n", + get_ctime(time(NULL), FALSE)); + // flush now, if fork/exec follows it could be written twice + fflush(log_fd); #ifdef FEAT_RELTIME profile_start(&log_start); #endif -- cgit v1.2.3