Browse Source

Merge pull request #12161 from RandomShaper/fix-log-overflow

Fix formatting of debug log overflow
Rémi Verschelde 7 years ago
parent
commit
4fb5b1a211
1 changed files with 8 additions and 4 deletions
  1. 8 4
      core/script_debugger_remote.cpp

+ 8 - 4
core/script_debugger_remote.cpp

@@ -855,15 +855,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_to_host()) {
 
+		if (overflowed)
+			s += "[...]";
+
 		sdr->output_strings.push_back(s);
+
+		if (overflowed) {
+			sdr->output_strings.push_back("[output overflow, print less text!]");
+		}
 	}
 	sdr->mutex->unlock();
 }