[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/master] 4772 - read LOGLEVEL on (re)load()
commit e1bf94ffce3bc59ec27a0d37b6fd5690eefd56a3
Author: aagbsn <aagbsn@xxxxxxxx>
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))
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits