Commit a0ece571 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix #353: limit logbox to 20k characters

parent a81f2e34
...@@ -1400,6 +1400,10 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1400,6 +1400,10 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
def addtexttolog(self, text): def addtexttolog(self, text):
try: try:
max_length = 20000
current_length = self.logbox.GetLastPosition()
if current_length > max_length:
self.logbox.Remove(0, current_length / 10)
self.logbox.AppendText(text) self.logbox.AppendText(text)
except: except:
print _("Attempted to write invalid text to console, which could be due to an invalid baudrate") print _("Attempted to write invalid text to console, which could be due to an invalid baudrate")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment