def log_traceback(log=log, level=logging.DEBUG):
 for line in traceback.format_exc().splitlines():
  log.log(level, line)

def log_traceback ( log = log , level = logging . DEBUG ) : for line in traceback . format_exc ( ) . splitlines ( ) : log . log ( level , line )
log the whole exception in the stack .