From a7d4d0f232231eb3d22c85d35ddfbcc2be0e587c Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Thu, 17 Dec 2020 12:24:34 +0100 Subject: [PATCH] GUI: added debug output for console prints this is useful for situations where the game crashes or is quit, but you still need to output of the debug commands for investigating the issue --- gui/console.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/console.cpp b/gui/console.cpp index 84fc9616ecd..bfc9488b694 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -675,10 +675,13 @@ int ConsoleDialog::printFormat(int dummy, const char *format, ...) { int ConsoleDialog::vprintFormat(int dummy, const char *format, va_list argptr) { Common::String buf = Common::String::vformat(format, argptr); + const int size = buf.size(); print(buf.c_str()); + buf.trim(); + debug("%s", buf.c_str()); - return buf.size(); + return size; } void ConsoleDialog::printChar(int c) {