diff --git a/plugins/EventLogging/__init__.py b/plugins/EventLogging/__init__.py index 60c036562..0e61eab57 100644 --- a/plugins/EventLogging/__init__.py +++ b/plugins/EventLogging/__init__.py @@ -18,7 +18,7 @@ plugin_name = _("Event Logging") plugin_author = "Micah Bucy" -plugin_version = "0.1" +plugin_version = "0.2" plugin_description = _(""" Adds a tab with log of selected events. @@ -35,6 +35,10 @@ saved to logs named after the events (eg peer_messages.log). Event messages in the log files also include a timestamp. The user is responsible to cleanout the logs. + +As of v0.2 +Events are now truncated in display. Log files are not. +New events are now displayed at the top. """) def deluge_init(deluge_path): diff --git a/plugins/EventLogging/tab_log.py b/plugins/EventLogging/tab_log.py index 42bb90d0e..bbce95e08 100644 --- a/plugins/EventLogging/tab_log.py +++ b/plugins/EventLogging/tab_log.py @@ -14,6 +14,7 @@ class LogManager(object): self.logdir = os.path.join(CONFIG_DIR, 'logs') if not os.path.isdir(self.logdir): os.mkdir(self.logdir) + self.labels = [] def clear_log_store(self): if not self.vbox is None: @@ -183,8 +184,12 @@ class LogManager(object): logfile.close() if not event_message is None: label = gtk.Label() + self.labels.append(label) label.set_text(event_message) label.set_alignment(0,0) label.set_selectable(True) - self.vbox.pack_start(label, expand=False) + self.vbox.pack_end(label, expand=False) + if len(self.labels)>100: + remove_label = self.labels.pop(0) + remove_label.destroy() label.show()