# HG changeset patch # User Christian Brabandt # Date 1533846606 -7200 # Node ID 2661d77e440e12d688e4ada931f068c850bf1757 # Parent fdfdc1d231d9e88ad37d24cff390832b0982ab8a patch 8.1.0263: channel log doesn't show part of channel commit https://github.com/vim/vim/commit/4b16ee743e26d65ecfb6231f7fd57869c3e5ff0d Author: Bram Moolenaar Date: Thu Aug 9 22:15:34 2018 +0200 patch 8.1.0263: channel log doesn't show part of channel Problem: Channel log doesn't show part of channel. Solution: Add "sock", "out", "err" or "in". (Ozaki Kiichi, closes https://github.com/vim/vim/issues/3303) diff --git a/src/channel.c b/src/channel.c --- a/src/channel.c +++ b/src/channel.c @@ -138,7 +138,7 @@ ch_log_active(void) } static void -ch_log_lead(const char *what, channel_T *ch) +ch_log_lead(const char *what, channel_T *ch, ch_part_T part) { if (log_fd != NULL) { @@ -150,7 +150,13 @@ ch_log_lead(const char *what, channel_T fprintf(log_fd, "%s ", profile_msg(&log_now)); #endif if (ch != NULL) - fprintf(log_fd, "%son %d: ", what, ch->ch_id); + { + if (part < PART_COUNT) + fprintf(log_fd, "%son %d(%s): ", + what, ch->ch_id, part_names[part]); + else + fprintf(log_fd, "%son %d: ", what, ch->ch_id); + } else fprintf(log_fd, "%s: ", what); } @@ -166,7 +172,7 @@ ch_log(channel_T *ch, const char *fmt, . { va_list ap; - ch_log_lead("", ch); + ch_log_lead("", ch, PART_COUNT); va_start(ap, fmt); vfprintf(log_fd, fmt, ap); va_end(ap); @@ -191,7 +197,7 @@ ch_error(channel_T *ch, const char *fmt, { va_list ap; - ch_log_lead("ERR ", ch); + ch_log_lead("ERR ", ch, PART_COUNT); va_start(ap, fmt); vfprintf(log_fd, fmt, ap); va_end(ap); @@ -1849,7 +1855,7 @@ channel_save(channel_T *channel, ch_part if (ch_log_active() && lead != NULL) { - ch_log_lead(lead, channel); + ch_log_lead(lead, channel, part); fprintf(log_fd, "'"); ignored = (int)fwrite(buf, len, 1, log_fd); fprintf(log_fd, "'\n"); @@ -3718,7 +3724,7 @@ channel_send( if (ch_log_active()) { - ch_log_lead("SEND ", channel); + ch_log_lead("SEND ", channel, part); fprintf(log_fd, "'"); ignored = (int)fwrite(buf_arg, len_arg, 1, log_fd); fprintf(log_fd, "'\n"); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -795,6 +795,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 263, +/**/ 262, /**/ 261,