Skip to content

Commit

Permalink
vklochan#30 Inconsistency in LogstashFormatterBase.serialize method f…
Browse files Browse the repository at this point in the history
…or python 3
  • Loading branch information
RomkaSk committed Jul 27, 2023
1 parent a795733 commit 0d51468
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions logstash/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ def format_exception(cls, exc_info):

@classmethod
def serialize(cls, message):
if sys.version_info < (3, 0):
return json.dumps(message)
else:
return bytes(json.dumps(message, default=str), 'utf-8')
return json.dumps(message)


class LogstashFormatterVersion0(LogstashFormatterBase):
version = 0
Expand Down

0 comments on commit 0d51468

Please sign in to comment.