Include traceback in some debug logging. Use `exc_info`.

Include traceback in some debug logging. Use `exc_info` instead of formatting the exception "by hand".