1
0
forked from aniani/vim

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 #3303)
This commit is contained in:
Bram Moolenaar
2018-08-09 22:15:34 +02:00
parent 1598f9937a
commit 4b16ee743e
2 changed files with 14 additions and 6 deletions

View File

@@ -138,7 +138,7 @@ ch_log_active(void)
} }
static 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) if (log_fd != NULL)
{ {
@@ -150,7 +150,13 @@ ch_log_lead(const char *what, channel_T *ch)
fprintf(log_fd, "%s ", profile_msg(&log_now)); fprintf(log_fd, "%s ", profile_msg(&log_now));
#endif #endif
if (ch != NULL) 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 else
fprintf(log_fd, "%s: ", what); fprintf(log_fd, "%s: ", what);
} }
@@ -166,7 +172,7 @@ ch_log(channel_T *ch, const char *fmt, ...)
{ {
va_list ap; va_list ap;
ch_log_lead("", ch); ch_log_lead("", ch, PART_COUNT);
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(log_fd, fmt, ap); vfprintf(log_fd, fmt, ap);
va_end(ap); va_end(ap);
@@ -191,7 +197,7 @@ ch_error(channel_T *ch, const char *fmt, ...)
{ {
va_list ap; va_list ap;
ch_log_lead("ERR ", ch); ch_log_lead("ERR ", ch, PART_COUNT);
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(log_fd, fmt, ap); vfprintf(log_fd, fmt, ap);
va_end(ap); va_end(ap);
@@ -1849,7 +1855,7 @@ channel_save(channel_T *channel, ch_part_T part, char_u *buf, int len,
if (ch_log_active() && lead != NULL) if (ch_log_active() && lead != NULL)
{ {
ch_log_lead(lead, channel); ch_log_lead(lead, channel, part);
fprintf(log_fd, "'"); fprintf(log_fd, "'");
ignored = (int)fwrite(buf, len, 1, log_fd); ignored = (int)fwrite(buf, len, 1, log_fd);
fprintf(log_fd, "'\n"); fprintf(log_fd, "'\n");
@@ -3718,7 +3724,7 @@ channel_send(
if (ch_log_active()) if (ch_log_active())
{ {
ch_log_lead("SEND ", channel); ch_log_lead("SEND ", channel, part);
fprintf(log_fd, "'"); fprintf(log_fd, "'");
ignored = (int)fwrite(buf_arg, len_arg, 1, log_fd); ignored = (int)fwrite(buf_arg, len_arg, 1, log_fd);
fprintf(log_fd, "'\n"); fprintf(log_fd, "'\n");

View File

@@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
263,
/**/ /**/
262, 262,
/**/ /**/