From c41a2a82795719f4f34a03e34b3e216bcb624cd2 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Wed, 15 Feb 2012 06:18:27 +0100 Subject: [PATCH] Log console: flush sooner rather than later --- base/src/base/console/log_console.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/base/src/base/console/log_console.cc b/base/src/base/console/log_console.cc index 29bdc881f3..1c2294fdd0 100644 --- a/base/src/base/console/log_console.cc +++ b/base/src/base/console/log_console.cc @@ -44,16 +44,14 @@ class Log_console : public Console void _out_char(char c) { - /* flush full buffer */ - if (_num_chars >= sizeof(_buf) - 1) _flush(); - /* ensure enough buffer space for complete escape sequence */ if ((c == 27) && (_num_chars + 8 > _BUF_SIZE)) _flush(); _buf[_num_chars++] = c; /* flush immediately on line break */ - if (c == '\n') _flush(); + if (c == '\n' || _num_chars >= sizeof(_buf) - 1) + _flush(); } public: