diff --git a/podaac/swodlr_common/logging.py b/podaac/swodlr_common/logging.py index c7cbf15..86b6ade 100644 --- a/podaac/swodlr_common/logging.py +++ b/podaac/swodlr_common/logging.py @@ -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): @@ -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))