Mercurial > vim
changeset 14499:2661d77e440e v8.1.0263
patch 8.1.0263: channel log doesn't show part of channel
commit https://github.com/vim/vim/commit/4b16ee743e26d65ecfb6231f7fd57869c3e5ff0d
Author: Bram Moolenaar <Bram@vim.org>
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Aug 2018 22:30:06 +0200 |
parents | fdfdc1d231d9 |
children | cb175ab74dff |
files | src/channel.c src/version.c |
diffstat | 2 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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");