Commit dc969644 authored by Mike Perry's avatar Mike Perry
Browse files

Demote loglevel back down to notice.

Also fix issues with logging system usage and upgrade some messages.
parent a06038c6
......@@ -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).")
......
......@@ -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))
......@@ -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)
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9110
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9110
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9110
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9110
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9120
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9120
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9120
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9120
control_host = 127.0.0.1
......
[TorCtl]
loglevel=WARN
loglevel = NOTICE
tor_host = 127.0.0.1
tor_port = 9120
control_host = 127.0.0.1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment