From 0b639af7d644ba39ee5f0a2be67252958b57f922 Mon Sep 17 00:00:00 2001 From: Vanhala Antti Date: Thu, 3 Apr 2014 21:09:38 +0300 Subject: [PATCH] Better logging behaviour with gdb --- mapper/makeGraph.py | 3 +-- mapper/start-mappers.sh | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mapper/makeGraph.py b/mapper/makeGraph.py index ded7610..b7fb26a 100755 --- a/mapper/makeGraph.py +++ b/mapper/makeGraph.py @@ -96,8 +96,7 @@ def get_full_network(): try: nodes, edges = get_network_from_cjdns(conf.rpc_connect, port, conf.rpc_pw) except Exception as ex: - print 'Fail!' - print traceback.format_exc() + print 'Fail! Node unresponsive!' continue print '%d nodes, %d edges' % (len(nodes), len(edges)) diff --git a/mapper/start-mappers.sh b/mapper/start-mappers.sh index a08da4e..ce422f2 100755 --- a/mapper/start-mappers.sh +++ b/mapper/start-mappers.sh @@ -23,7 +23,10 @@ do sed -i 's/"type": "TUNInterface"/\/\/"type": "TUNInterface"/g' $file 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 $cjdns_path/cjdroute < $file fi