summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-12 15:09:23 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-12 15:09:23 +0100
commitc9a9a0ac1ec3b985d38c01ddf9f0ba2f15386f34 (patch)
treefb5fdcc958f7d680b56c8a096f033afd5874fef7 /src/channel.c
parent60895f3e36def9beb7d5463e792e5154ad9a7a0a (diff)
patch 8.2.4742: there is no way to start logging very early in startupv8.2.4742
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.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c5
1 files changed, 4 insertions, 1 deletions
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