Skip to content

Commit

Permalink
only try to format log message if args are of correct type and length (
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Burda authored Jul 8, 2021
1 parent 0c614e1 commit a7a94f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion enochecker3/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class ELKFormatter(logging.Formatter):
def format(self, record: logging.LogRecord) -> str:
if record.args is not None:
if type(record.args) is tuple and len(record.args) > 0:
record.msg = record.msg % record.args

return LOGGING_PREFIX + self.create_message(record).json(by_alias=True)
Expand Down

0 comments on commit a7a94f4

Please sign in to comment.