[tor-commits] [bridgedb/master] 4772 - read LOGLEVEL on (re)load()

aagbsn at torproject.org aagbsn at torproject.org
Sat Mar 16 23:46:31 UTC 2013


commit e1bf94ffce3bc59ec27a0d37b6fd5690eefd56a3
Author: aagbsn <aagbsn at extc.org>
Date:   Sun Jun 24 06:49:13 2012 -0700

    4772 - read LOGLEVEL on (re)load()
---
 lib/bridgedb/Main.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index 977f37a..d8a5c3c 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -336,6 +336,18 @@ def startup(cfg):
     # Make the parse-bridges function get re-called on SIGHUP.
     def reload():
         logging.info("Caught SIGHUP")
+
+        # re open config file
+        options, arguments = Opt.parseOpts()
+        configuration = {}
+        if options.configfile:
+            execfile(options.configfile, configuration)
+            cfg = Conf(**configuration)
+            # update loglevel on (re)load
+            level = getattr(cfg, 'LOGLEVEL', 'WARNING')
+            level = getattr(logging, level)
+            logging.getLogger().setLevel(level)
+
         load(cfg, splitter, clear=True)
         proxyList.replaceProxyList(loadProxyList(cfg))
         logging.info("%d bridges loaded", len(splitter))





More information about the tor-commits mailing list