From 303c823588fd1269caa532a349cde250c11882c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Mon, 16 Oct 2017 22:10:11 +0200 Subject: [PATCH] Fix formatting of debug log overflow Fixes #12087. (cherry picked from commit d645b80e468da7c8dcf8d55aec96f860dd64eaec) --- core/script_debugger_remote.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 0d8f411a3a6..31e2329f9eb 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -1069,15 +1069,19 @@ void ScriptDebuggerRemote::_print_handler(void *p_this, const String &p_string) } sdr->char_count += allowed_chars; - - if (sdr->char_count >= sdr->max_cps) { - s += "\n[output overflow, print less text!]\n"; - } + bool overflowed = sdr->char_count >= sdr->max_cps; sdr->mutex->lock(); if (!sdr->locking && sdr->tcp_client->is_connected()) { + if (overflowed) + s += "[...]"; + sdr->output_strings.push_back(s); + + if (overflowed) { + sdr->output_strings.push_back("[output overflow, print less text!]"); + } } sdr->mutex->unlock(); }