[or-cvs] r22948: {arm} change: moving shutdown notice from log panel to tor util (in arm/trunk: . interface util)

Damian Johnson atagar1 at gmail.com
Wed Aug 18 15:24:52 UTC 2010


Author: atagar
Date: 2010-08-18 15:24:51 +0000 (Wed, 18 Aug 2010)
New Revision: 22948

Modified:
   arm/trunk/armrc.sample
   arm/trunk/interface/logPanel.py
   arm/trunk/util/torTools.py
Log:
change: moving shutdown notice from log panel to tor util



Modified: arm/trunk/armrc.sample
===================================================================
--- arm/trunk/armrc.sample	2010-08-18 12:14:15 UTC (rev 22947)
+++ arm/trunk/armrc.sample	2010-08-18 15:24:51 UTC (rev 22948)
@@ -15,7 +15,7 @@
 # Limits are to prevent big log files from causing a slow startup time. For
 # instance, if arm's only listening for ERR entries but the log has all
 # runlevels then this will add the first <prepopulateAddLimit> ERR entries and
-# stop reading after <prepopulateReadLimit> lines
+# stop reading after <prepopulateReadLimit> lines.
 
 features.log.prepopulate true
 features.log.prepopulateAddLimit 1000
@@ -78,6 +78,7 @@
 log.configEntryNotFound NONE
 log.configEntryUndefined NOTICE
 log.configEntryTypeError NOTICE
+log.torCtlPortClosed NOTICE
 log.torGetInfo DEBUG
 log.torGetConf DEBUG
 log.sysCallMade DEBUG

Modified: arm/trunk/interface/logPanel.py
===================================================================
--- arm/trunk/interface/logPanel.py	2010-08-18 12:14:15 UTC (rev 22947)
+++ arm/trunk/interface/logPanel.py	2010-08-18 15:24:51 UTC (rev 22948)
@@ -272,7 +272,7 @@
     if TOR_CTL_CLOSE_MSG in msg:
       # TorCtl providing notice that control port is closed
       self.controlPortClosed = True
-      log.log(log.NOTICE, "Tor control port closed")
+      #log.log(log.NOTICE, "Tor control port closed")
       
       # Allows the Controller to notice that tor's shut down.
       # TODO: should make the controller the torctl event listener rather than

Modified: arm/trunk/util/torTools.py
===================================================================
--- arm/trunk/util/torTools.py	2010-08-18 12:14:15 UTC (rev 22947)
+++ arm/trunk/util/torTools.py	2010-08-18 15:24:51 UTC (rev 22948)
@@ -46,7 +46,7 @@
 
 TOR_CTL_CLOSE_MSG = "Tor closed control connection. Exiting event thread."
 UNKNOWN = "UNKNOWN" # value used by cached information if undefined
-CONFIG = {"log.torGetInfo": log.DEBUG, "log.torGetConf": log.DEBUG}
+CONFIG = {"log.torCtlPortClosed": log.NOTICE, "log.torGetInfo": log.DEBUG, "log.torGetConf": log.DEBUG}
 
 # events used for controller functionality:
 # NOTICE - used to detect when tor is shut down
@@ -890,6 +890,7 @@
     Called on any event occurance to note the time it occured.
     """
     
+    # alternative is to use the event's timestamp (via event.arrived_at)
     self.lastHeartbeat = time.time()
   
   def _getRelayAttr(self, key, default, cacheUndefined = True):
@@ -999,6 +1000,10 @@
     # resets cached getInfo parameters
     self._cachedParam = dict([(arg, "") for arg in CACHE_ARGS])
     
+    # gives a notice that the control port has closed
+    if eventType == TOR_CLOSED:
+      log.log(CONFIG["log.torCtlPortClosed"], "Tor control port closed")
+    
     for callback in self.statusListeners:
       callback(self, eventType)
 



More information about the tor-commits mailing list