Skip to content

Commit

Permalink
Try making log display compatible with non-JSON-able lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lbianchi-lbl committed Mar 27, 2024
1 parent 5aa53b4 commit 4db343c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/electrolytedb/_pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ def _wait_for_server_online(self, retry_intervals_s: list, **kwargs):

def _display_logs(self, logs: str):
for line in logs.splitlines():
event = json.loads(line)
pretty = json.dumps(event, indent=4)
print(pretty)
try:
event_data = json.loads(line)
to_print = json.dumps(event, indent=4)
except Exception as e:
to_print = line
print(to_print)

def setup(self):
self._tmpdir = tempfile.TemporaryDirectory()
Expand Down

0 comments on commit 4db343c

Please sign in to comment.