commit 1e5811b1b0739f5b2366394d3afd0bd7ec5bd06f Author: Isis Lovecruft isis@torproject.org Date: Tue Nov 5 05:42:48 2013 +0000
Fix logs in bridgedb.Main to record the filename that was used.
There were a couple loglines in bridgedb.Main, most of them for when the descriptor files are opened/closed, which did ``os.path.abspath`` on the filename string taken from the config, and then logged statements like "Opening something something file: %s" with the absolute path. On the next line, the non-absolute path of the filename is opened.
* CHANGE log statements to record paths as they are passed to open(). --- lib/bridgedb/Main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py index 824d328..964c737 100644 --- a/lib/bridgedb/Main.py +++ b/lib/bridgedb/Main.py @@ -85,7 +85,7 @@ def load(cfg, splitter, clear=False): addresses = {} timestamps = {} if hasattr(cfg, "STATUS_FILE"): - logging.info("Opening Network Status document %s", os.path.abspath(cfg.STATUS_FILE)) + logging.info("Opening Network Status document %s" % cfg.STATUS_FILE) f = open(cfg.STATUS_FILE, 'r') for ID, running, stable, or_addresses, timestamp in Bridges.parseStatusFile(f): status[ID] = running, stable @@ -126,7 +126,7 @@ def load(cfg, splitter, clear=False): for timestamp in ts: bridgedb.Stability.addOrUpdateBridgeHistory( bridge, timestamp) - logging.debug("Closing descriptor document") + logging.debug("Closing server-descriptor document") f.close()
# read pluggable transports from extra-info document @@ -328,7 +328,8 @@ def startup(cfg, options):
# Dump bridge pool assignments to disk. try: - logging.debug("Dumping pool assignments file") + logging.debug("Dumping pool assignments to file: '%s'" + % cfg.ASSIGNMENTS_FILE) f = open(cfg.ASSIGNMENTS_FILE, 'a') f.write("bridge-pool-assignment %s\n" % time.strftime("%Y-%m-%d %H:%M:%S"))
tor-commits@lists.torproject.org