5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-11-09 16:00:27 +00:00

Better logging behaviour with gdb

This commit is contained in:
Vanhala Antti 2014-04-03 21:09:38 +03:00
parent 1ed805a7e6
commit 0b639af7d6
2 changed files with 5 additions and 3 deletions

View File

@ -96,8 +96,7 @@ def get_full_network():
try: try:
nodes, edges = get_network_from_cjdns(conf.rpc_connect, port, conf.rpc_pw) nodes, edges = get_network_from_cjdns(conf.rpc_connect, port, conf.rpc_pw)
except Exception as ex: except Exception as ex:
print 'Fail!' print 'Fail! Node unresponsive!'
print traceback.format_exc()
continue continue
print '%d nodes, %d edges' % (len(nodes), len(edges)) print '%d nodes, %d edges' % (len(nodes), len(edges))

View File

@ -23,7 +23,10 @@ do
sed -i 's/"type": "TUNInterface"/\/\/"type": "TUNInterface"/g' $file sed -i 's/"type": "TUNInterface"/\/\/"type": "TUNInterface"/g' $file
if [[ $* == *-d* ]]; then if [[ $* == *-d* ]]; then
gdb $cjdns_path/cjdroute -ex 'set follow-fork-mode child' -ex 'run < '"${file}" -ex 'thread apply all bt' -ex 'quit' 2>&1 | tee gdb-$i.log & # Log to stdout
sed -i 's/\/\/ "logTo":"stdout"/"logTo":"stdout"/g' $file
gdb $cjdns_path/cjdroute -ex 'set follow-fork-mode child' -ex 'run < '"${file}" -ex 'thread apply all bt' -ex 'quit' > gdb-$i.log 2>&1 &
else else
$cjdns_path/cjdroute < $file $cjdns_path/cjdroute < $file
fi fi