Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #28 from pdewacht/master
Browse files Browse the repository at this point in the history
Fix NoStacktraceFormatter
  • Loading branch information
mathiasose committed Feb 8, 2021
2 parents c0db2f0 + 32df3d8 commit fea8e1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions slacker_log_handler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ class NoStacktraceFormatter(Formatter):
def formatException(self, ei):
return None

def format(self, record):
# Work-around for https://bugs.python.org/issue29056
saved_exc_text = record.exc_text
record.exc_text = None
try:
return super(NoStacktraceFormatter, self).format(record)
finally:
record.exc_text = saved_exc_text


class SlackerLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=True, username='Python logger', icon_url=None, icon_emoji=None,
Expand Down

0 comments on commit fea8e1b

Please sign in to comment.