Skip to content

Commit

Permalink
Only format dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Oct 9, 2024
1 parent c9abd2d commit 9be0a64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion griptape/configs/logging/json_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ def __attrs_pre_init__(self) -> None:
super().__init__()

def format(self, record: Any) -> str:
record.msg = json.dumps(record.msg, indent=self.indent)
if isinstance(record.msg, dict):
record.msg = json.dumps(record.msg, indent=self.indent)

return super().format(record)

0 comments on commit 9be0a64

Please sign in to comment.