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)
diff --git a/src/channel.c b/src/channel.c
index de2f50d..282340e 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -138,7 +138,7 @@
}
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 @@
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 @@
{
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 @@
{
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 @@
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 @@
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
index 1cd58f0..6543e91 100644
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 263,
+/**/
262,
/**/
261,