Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgarde committed May 24, 2024
1 parent e9f8efd commit 7f070e2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions podaac/swodlr_common/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 28,7 @@ class LaxJsonEncoder(json.JSONEncoder):
'''

def default(self, o):
try:
return str(o)
except:
self.default(o)
return str(o)


class JsonFormatter(Formatter):
Expand Down Expand Up @@ -65,4 62,4 @@ def format(self, record: LogRecord, _datefmt=None):
if hasattr(record, key):
output.update(**{key: getattr(record, key)})

return json.dumps(output, cls=LaxJsonEncoder)
return json.dumps(output, default=lambda o: str(o))

0 comments on commit 7f070e2

Please sign in to comment.