Skip to content

Commit d0b6502

Browse files
committed
patch 7.4.1505
Problem: When channel log is enabled get too many "looking for messages" log entries. Solution: Only give the message after another message.
1 parent 3f39f64 commit d0b6502

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/channel.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ ch_log_lead(char *what, channel_T *ch)
136136
}
137137
}
138138

139+
static int did_log_msg = TRUE;
140+
139141
void
140142
ch_log(channel_T *ch, char *msg)
141143
{
@@ -145,6 +147,7 @@ ch_log(channel_T *ch, char *msg)
145147
fputs(msg, log_fd);
146148
fputc('\n', log_fd);
147149
fflush(log_fd);
150+
did_log_msg = TRUE;
148151
}
149152
}
150153

@@ -157,6 +160,7 @@ ch_logn(channel_T *ch, char *msg, int nr)
157160
fprintf(log_fd, msg, nr);
158161
fputc('\n', log_fd);
159162
fflush(log_fd);
163+
did_log_msg = TRUE;
160164
}
161165
}
162166

@@ -169,6 +173,7 @@ ch_logs(channel_T *ch, char *msg, char *name)
169173
fprintf(log_fd, msg, name);
170174
fputc('\n', log_fd);
171175
fflush(log_fd);
176+
did_log_msg = TRUE;
172177
}
173178
}
174179

@@ -181,6 +186,7 @@ ch_logsn(channel_T *ch, char *msg, char *name, int nr)
181186
fprintf(log_fd, msg, name, nr);
182187
fputc('\n', log_fd);
183188
fflush(log_fd);
189+
did_log_msg = TRUE;
184190
}
185191
}
186192

@@ -193,6 +199,7 @@ ch_error(channel_T *ch, char *msg)
193199
fputs(msg, log_fd);
194200
fputc('\n', log_fd);
195201
fflush(log_fd);
202+
did_log_msg = TRUE;
196203
}
197204
}
198205

@@ -205,6 +212,7 @@ ch_errorn(channel_T *ch, char *msg, int nr)
205212
fprintf(log_fd, msg, nr);
206213
fputc('\n', log_fd);
207214
fflush(log_fd);
215+
did_log_msg = TRUE;
208216
}
209217
}
210218

@@ -217,6 +225,7 @@ ch_errors(channel_T *ch, char *msg, char *arg)
217225
fprintf(log_fd, msg, arg);
218226
fputc('\n', log_fd);
219227
fflush(log_fd);
228+
did_log_msg = TRUE;
220229
}
221230
}
222231

@@ -2352,6 +2361,7 @@ channel_send(channel_T *channel, int part, char_u *buf, char *fun)
23522361
ignored = (int)fwrite(buf, len, 1, log_fd);
23532362
fprintf(log_fd, "'\n");
23542363
fflush(log_fd);
2364+
did_log_msg = TRUE;
23552365
}
23562366

23572367
if (part == PART_SOCK)
@@ -2541,7 +2551,13 @@ channel_parse_messages(void)
25412551
int r;
25422552
int part = PART_SOCK;
25432553

2544-
ch_log(NULL, "looking for messages on channels");
2554+
/* Only do this message when another message was given, otherwise we get
2555+
* lots of them. */
2556+
if (did_log_msg)
2557+
{
2558+
ch_log(NULL, "looking for messages on channels");
2559+
did_log_msg = FALSE;
2560+
}
25452561
while (channel != NULL)
25462562
{
25472563
if (channel->ch_refcount == 0 && !channel_still_useful(channel))

src/version.c

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

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1505,
746748
/**/
747749
1504,
748750
/**/

0 commit comments

Comments
 (0)