[tor-commits] [nyx/master] Drop features.log.showDateDividers

atagar at torproject.org atagar at torproject.org
Tue May 5 05:42:06 UTC 2015


commit de740bae89566eb4d436d2d8f902bed0ccafcd0e
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon May 4 21:35:01 2015 -0700

    Drop features.log.showDateDividers
    
    Drop the ability to opt out of grouping by days. Never known this to be useful,
    and probably not worth accounting this in our new draw() function.
    
    Also fixing features.log.maxLinesPerEntry and features.logFile. They were
    documented as being camel case in our nyxrc.sample (like all options), but in
    the code it wasn't.
---
 nyx/log_panel.py |   15 +++++++--------
 nyxrc.sample     |    3 ---
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 9685c77..300af83 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -22,7 +22,7 @@ from nyx.util import join, panel, tor_controller, ui_tools
 
 
 def conf_handler(key, value):
-  if key == 'features.log.max_lines_per_entry':
+  if key == 'features.log.maxLinesPerEntry':
     return max(1, value)
   elif key == 'features.log.prepopulateReadLimit':
     return max(0, value)
@@ -33,10 +33,9 @@ def conf_handler(key, value):
 
 
 CONFIG = conf.config_dict('nyx', {
-  'features.log_file': '',
-  'features.log.showDateDividers': True,
+  'features.logFile': '',
   'features.log.showDuplicateEntries': False,
-  'features.log.max_lines_per_entry': 6,
+  'features.log.maxLinesPerEntry': 6,
   'features.log.prepopulate': True,
   'features.log.prepopulateReadLimit': 5000,
   'features.log.maxRefreshRate': 300,
@@ -73,8 +72,8 @@ class LogPanel(panel.Panel, threading.Thread):
     self.setDaemon(True)
 
     self._logged_event_types = nyx.util.log.listen_for_events(self._register_tor_event, logged_events)
-    self._logged_events = nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = CONFIG['features.log.showDateDividers'])
-    self._log_file = nyx.util.log.LogFileOutput(CONFIG['features.log_file'])
+    self._logged_events = nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'])
+    self._log_file = nyx.util.log.LogFileOutput(CONFIG['features.logFile'])
     self._filter = nyx.util.log.LogFilters(initial_filters = CONFIG['features.log.regex'])
 
     self.set_pause_attr('_logged_events')
@@ -200,7 +199,7 @@ class LogPanel(panel.Panel, threading.Thread):
     """
 
     with self._lock:
-      self._logged_events = nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = CONFIG['features.log.showDateDividers'])
+      self._logged_events = nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'])
       self.redraw(True)
 
   def save_snapshot(self, path):
@@ -401,7 +400,7 @@ class LogPanel(panel.Panel, threading.Thread):
       while msg:
         x, msg = draw_line(x, y, width, msg, *attr)
 
-        if (y - orig_y + 1) >= CONFIG['features.log.max_lines_per_entry']:
+        if (y - orig_y + 1) >= CONFIG['features.log.maxLinesPerEntry']:
           break  # filled up the maximum number of lines we're allowing for
 
         if msg:
diff --git a/nyxrc.sample b/nyxrc.sample
index fadc5df..44b0228 100644
--- a/nyxrc.sample
+++ b/nyxrc.sample
@@ -59,8 +59,6 @@ features.confirmQuit true
 
 # Paremters for the log panel
 # ---------------------------
-# showDateDividers
-#   show borders with dates for entries from previous days
 # showDuplicateEntries
 #   shows all log entries if true, otherwise collapses similar entries with an
 #   indicator for how much is being hidden
@@ -77,7 +75,6 @@ features.confirmQuit true
 # regex
 #   preconfigured regular expression pattern, up to five will be loaded
 
-features.log.showDateDividers true
 features.log.showDuplicateEntries false
 features.log.maxLinesPerEntry 6
 features.log.prepopulate true





More information about the tor-commits mailing list