Use traceback for better traceback logging

cf http://docs.python.org/2/library/traceback.html?highlight=traceback.print_exc#traceback.print_exc