commit 1536e49ab8ab7369e1042fbee5efb1d0ba0b36fd
parent 25eb093fc8f2aec1a927194b527ddf190cc804d3
Author: Eric Davis <edavis@insanum.com>
Date: Mon, 14 Jul 2014 11:37:20 -0700
fixed issue with the max log limit
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sncli.py b/sncli.py
@@ -152,6 +152,7 @@ def log_timeout(self, loop, arg):
self.log_lock.acquire()
self.log_alarms -= 1
+
if self.log_alarms == 0:
self.gui_footer_log_clear()
self.logs = []
@@ -176,8 +177,11 @@ def log(self, msg):
self.log_lock.acquire()
+ self.log_alarms += 1
self.logs.append(msg)
+
if len(self.logs) > self.config.get_config('max_logs'):
+ self.log_alarms -= 1
self.logs.pop(0)
log_pile = []
@@ -189,7 +193,6 @@ def log(self, msg):
self.sncli_loop.set_alarm_in(
int(self.config.get_config('log_timeout')),
self.log_timeout, None)
- self.log_alarms += 1
self.log_lock.release()