Skip to content

Commit

Permalink
Merge pull request #103 from radimsuckr/fix/logging-json-encoder
Browse files Browse the repository at this point in the history
Do not use default for serializing JSON in logging
  • Loading branch information
matllubos committed Jun 29, 2020
2 parents 926d1ca + ea6497a commit 95991cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions chamber/utils/logging.py
Expand Up @@ -29,8 +29,7 @@ def emit(self, record):
for k, v in record.__dict__.items()
if k not in self.DEFAULT_STREAM_HANDLER_VARIABLE_KEYS.union(self.CUSTOM_STREAM_HANDLER_VARIABLE_KEYS)
}
record.msg = '{} --- {}'.format(record.msg, json.dumps(extra, cls=DjangoJSONEncoder,
default=lambda x: '<<NON-SERIALIZABLE TYPE: {}>>'.format(type(x).__qualname__)))
record.msg = '{} --- {}'.format(record.msg, json.dumps(extra, cls=DjangoJSONEncoder))
super().emit(record)


Expand Down

0 comments on commit 95991cd

Please sign in to comment.