Print exception information and stack trace entries from traceback object tb to file. This differs from print_tb() in the following ways:
traceback.print_exception(exc, /, [value, tb, ]limit=None, file=None, chain=True)