commit dc969644beb2495288fdcb7a7f0ff6d71f11d380 Author: Mike Perry mikeperry-git@torproject.org Date: Mon Jun 1 13:29:00 2015 -0700
Demote loglevel back down to notice.
Also fix issues with logging system usage and upgrade some messages. --- NetworkScanners/BwAuthority/aggregate.py | 7 +++---- NetworkScanners/BwAuthority/bwauthority.py | 16 +++++++++------- NetworkScanners/BwAuthority/bwauthority_child.py | 10 +++++----- .../BwAuthority/data/scanner.1/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.2/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.3/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.4/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.5/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.6/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.7/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.8/bwauthority.cfg | 2 +- .../BwAuthority/data/scanner.9/bwauthority.cfg | 2 +- 12 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/NetworkScanners/BwAuthority/aggregate.py b/NetworkScanners/BwAuthority/aggregate.py index 6d35dba..01ea8b5 100755 --- a/NetworkScanners/BwAuthority/aggregate.py +++ b/NetworkScanners/BwAuthority/aggregate.py @@ -362,13 +362,12 @@ def write_file_list(datadir):
def main(argv): TorUtil.read_config(argv[1]+"/scanner.1/bwauthority.cfg") - TorUtil.loglevel = "DEBUG" TorUtil.logfile = "data/aggregate-debug.log"
(branch, head) = TorUtil.get_git_version(PATH_TO_TORFLOW_REPO) - plog('INFO', 'TorFlow Version: %s' % branch+' '+head) + plog('NOTICE', 'TorFlow Version: %s' % branch+' '+head) (branch, head) = TorUtil.get_git_version(PATH_TO_TORCTL_REPO) - plog('INFO', 'TorCtl Version: %s' % branch+' '+head) + plog('NOTICE', 'TorCtl Version: %s' % branch+' '+head)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((TorUtil.control_host,TorUtil.control_port)) @@ -849,7 +848,7 @@ def main(argv): plog("INFO", "Avg network -pid_error="+str(sum(map(lambda n: n.pid_error, n_nodes))/len(n_nodes)))
- plog("INFO", + plog("NOTICE", "Measured "+str(measured_pct) +"% of all tor nodes (" +str(measured_bw_pct)+"% of previous consensus bw).")
diff --git a/NetworkScanners/BwAuthority/bwauthority.py b/NetworkScanners/BwAuthority/bwauthority.py index 6a04542..89c0d34 100755 --- a/NetworkScanners/BwAuthority/bwauthority.py +++ b/NetworkScanners/BwAuthority/bwauthority.py @@ -4,6 +4,7 @@ from sys import path from sys import exit from subprocess import Popen path.append("../../") +import TorCtl.TorUtil from TorCtl.TorUtil import plog as plog from TorCtl.TorUtil import get_git_version as get_git_version from signal import signal, SIGTERM, SIGKILL @@ -21,10 +22,11 @@ PATH_TO_TORCTL_REPO = '../../.git/modules/TorCtl/' p = None
def main(argv): + TorCtl.TorUtil.read_config(argv[1]) (branch, head) = get_git_version(PATH_TO_TORFLOW_REPO) - plog('INFO', 'TorFlow Version: %s' % branch+' '+head) + plog('NOTICE', 'TorFlow Version: %s' % branch+' '+head) (branch, head) = get_git_version(PATH_TO_TORCTL_REPO) - plog('INFO', 'TorCtl Version: %s' % branch+' '+head) + plog('NOTICE', 'TorCtl Version: %s' % branch+' '+head) slice_num = 0 while True: plog('INFO', 'Beginning time loop') @@ -34,9 +36,9 @@ def main(argv): if (p.returncode == 0): slice_num += 1 elif (p.returncode == RESTART_SLICE): - plog('INFO', 'restarting slice_num '+str(slice_num)) + plog('NOTICE', 'restarting slice_num '+str(slice_num)) elif (p.returncode == STOP_PCT_REACHED): - plog('INFO', 'restarting from slice 0') + plog('NOTICE', 'restarting from slice 0') slice_num = 0 elif (abs(p.returncode) == SIGKILL): plog('WARN', 'Child process recieved SIGKILL, exiting') @@ -67,6 +69,6 @@ if __name__ == '__main__': except KeyboardInterrupt: global p p.kill() - plog('INFO', "Ctrl + C was pressed. Exiting ... ") - except Exception, e: - plog('ERROR', "An unexpected error occured.") + plog('NOTICE', "Ctrl + C was pressed. Exiting ... ") + except Exception as e: + plog('ERROR', "An unexpected error occured: "+str(e)) diff --git a/NetworkScanners/BwAuthority/bwauthority_child.py b/NetworkScanners/BwAuthority/bwauthority_child.py index a42a9b5..a36728f 100755 --- a/NetworkScanners/BwAuthority/bwauthority_child.py +++ b/NetworkScanners/BwAuthority/bwauthority_child.py @@ -221,6 +221,7 @@ class BwScanHandler(ScanSupport.SQLScanHandler): def speedrace(hdlr, start_pct, stop_pct, circs_per_node, save_every, out_dir, max_fetch_time, sleep_start_tp, sleep_stop_tp, slice_num, min_streams, sql_file, only_unmeasured): + plog("NOTICE", "Starting slice for percentiles "+str(start_pct)+"-"+str(stop_pct)) hdlr.set_pct_rstr(start_pct, stop_pct)
attempt = 0 @@ -300,12 +301,12 @@ def speedrace(hdlr, start_pct, stop_pct, circs_per_node, save_every, out_dir, return successful
def main(argv): - plog("DEBUG", "Child Process Spawning...") TorUtil.read_config(argv[1]) (start_pct,stop_pct,nodes_per_slice,save_every,circs_per_node,out_dir, max_fetch_time,tor_dir,sleep_start,sleep_stop, min_streams,pid_file_name,db_url,only_unmeasured, min_unmeasured) = read_config(argv[1]) + plog("NOTICE", "Child Process Spawned...")
# make sure necessary out_dir directory exists path = os.getcwd()+'/'+out_dir @@ -365,10 +366,9 @@ def main(argv):
# check to see if we are done if (slice_num * pct_step + start_pct > stop_pct): - plog('INFO', 'stop_pct: %s reached. Exiting with %s' % (stop_pct, STOP_PCT_REACHED)) + plog('NOTICE', 'Child stop point %s reached. Exiting with %s' % (stop_pct, STOP_PCT_REACHED)) sys.exit(STOP_PCT_REACHED)
- plog("DEBUG", "Starting slice number %s" % slice_num) successful = speedrace(hdlr, slice_num*pct_step + start_pct, (slice_num + 1)*pct_step + start_pct, circs_per_node, save_every, out_dir, max_fetch_time, sleep_start, sleep_stop, slice_num, min_streams, sql_file, only_unmeasured) @@ -383,9 +383,9 @@ def main(argv): # out_dir, max_fetch_time, sleep_start, sleep_stop, slice_num, sql_file)
# XXX: Hack this to return a codelen double the slice size on failure? - plog("NOTICE", "Slice success count: "+str(successful)) + plog("INFO", "Slice success count: "+str(successful)) if successful == 0: - plog("NOTICE", "Slice success count is ZERO!") + plog("WARN", "Slice success count was ZERO!")
sys.exit(0)
diff --git a/NetworkScanners/BwAuthority/data/scanner.1/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.1/bwauthority.cfg index ad9a4cd..f58a4e2 100644 --- a/NetworkScanners/BwAuthority/data/scanner.1/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.1/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9110 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.2/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.2/bwauthority.cfg index 3e94e5e..73190c9 100644 --- a/NetworkScanners/BwAuthority/data/scanner.2/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.2/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9110 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.3/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.3/bwauthority.cfg index 71c3285..9a97c50 100644 --- a/NetworkScanners/BwAuthority/data/scanner.3/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.3/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9110 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.4/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.4/bwauthority.cfg index 9a676ec..29204d6 100644 --- a/NetworkScanners/BwAuthority/data/scanner.4/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.4/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9110 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.5/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.5/bwauthority.cfg index 1acb1a2..d3e619e 100644 --- a/NetworkScanners/BwAuthority/data/scanner.5/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.5/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9120 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.6/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.6/bwauthority.cfg index 5bc3616..4851165 100755 --- a/NetworkScanners/BwAuthority/data/scanner.6/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.6/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9120 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.7/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.7/bwauthority.cfg index 2898b80..a81b0ac 100755 --- a/NetworkScanners/BwAuthority/data/scanner.7/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.7/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9120 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.8/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.8/bwauthority.cfg index 56a5cfa..25515f7 100755 --- a/NetworkScanners/BwAuthority/data/scanner.8/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.8/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9120 control_host = 127.0.0.1 diff --git a/NetworkScanners/BwAuthority/data/scanner.9/bwauthority.cfg b/NetworkScanners/BwAuthority/data/scanner.9/bwauthority.cfg index 7e49dbb..7cbbded 100644 --- a/NetworkScanners/BwAuthority/data/scanner.9/bwauthority.cfg +++ b/NetworkScanners/BwAuthority/data/scanner.9/bwauthority.cfg @@ -1,5 +1,5 @@ [TorCtl] -loglevel=WARN +loglevel = NOTICE tor_host = 127.0.0.1 tor_port = 9120 control_host = 127.0.0.1
tor-commits@lists.torproject.org