Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow for exception_formatter=None
  • Loading branch information
blueyed committed Apr 9, 2019
commit dadac80ef1c86a0a20d80d35c0f970633e1b8b54
6 changes: 3 additions & 3 deletions loguru/_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ def emit(self, record, level_color, ansi_message, raw):

formatter_record = record.copy()

if not record["exception"]:
error = ""
else:
if record["exception"] and self._exception_formatter:
type_, value, tb = record["exception"]
lines = self._exception_formatter.format_exception(type_, value, tb)
error = "".join(lines)
else:
error = ""

formatter_record["exception"] = error

Expand Down