Skip to content

Commit 4b16ee7

Browse files
committed
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)
1 parent 1598f99 commit 4b16ee7

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/channel.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ ch_log_active(void)
138138
}
139139

140140
static void
141-
ch_log_lead(const char *what, channel_T *ch)
141+
ch_log_lead(const char *what, channel_T *ch, ch_part_T part)
142142
{
143143
if (log_fd != NULL)
144144
{
@@ -150,7 +150,13 @@ ch_log_lead(const char *what, channel_T *ch)
150150
fprintf(log_fd, "%s ", profile_msg(&log_now));
151151
#endif
152152
if (ch != NULL)
153-
fprintf(log_fd, "%son %d: ", what, ch->ch_id);
153+
{
154+
if (part < PART_COUNT)
155+
fprintf(log_fd, "%son %d(%s): ",
156+
what, ch->ch_id, part_names[part]);
157+
else
158+
fprintf(log_fd, "%son %d: ", what, ch->ch_id);
159+
}
154160
else
155161
fprintf(log_fd, "%s: ", what);
156162
}
@@ -166,7 +172,7 @@ ch_log(channel_T *ch, const char *fmt, ...)
166172
{
167173
va_list ap;
168174

169-
ch_log_lead("", ch);
175+
ch_log_lead("", ch, PART_COUNT);
170176
va_start(ap, fmt);
171177
vfprintf(log_fd, fmt, ap);
172178
va_end(ap);
@@ -191,7 +197,7 @@ ch_error(channel_T *ch, const char *fmt, ...)
191197
{
192198
va_list ap;
193199

194-
ch_log_lead("ERR ", ch);
200+
ch_log_lead("ERR ", ch, PART_COUNT);
195201
va_start(ap, fmt);
196202
vfprintf(log_fd, fmt, ap);
197203
va_end(ap);
@@ -1849,7 +1855,7 @@ channel_save(channel_T *channel, ch_part_T part, char_u *buf, int len,
18491855

18501856
if (ch_log_active() && lead != NULL)
18511857
{
1852-
ch_log_lead(lead, channel);
1858+
ch_log_lead(lead, channel, part);
18531859
fprintf(log_fd, "'");
18541860
ignored = (int)fwrite(buf, len, 1, log_fd);
18551861
fprintf(log_fd, "'\n");
@@ -3718,7 +3724,7 @@ channel_send(
37183724

37193725
if (ch_log_active())
37203726
{
3721-
ch_log_lead("SEND ", channel);
3727+
ch_log_lead("SEND ", channel, part);
37223728
fprintf(log_fd, "'");
37233729
ignored = (int)fwrite(buf_arg, len_arg, 1, log_fd);
37243730
fprintf(log_fd, "'\n");

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ static char *(features[]) =
794794

795795
static int included_patches[] =
796796
{ /* Add new patch number below this line */
797+
/**/
798+
263,
797799
/**/
798800
262,
799801
/**/

0 commit comments

Comments
 (0)