Skip to content

Commit

Permalink
Improve live engines error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Nov 18, 2024
1 parent 2606768 commit ae07595
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Released on TBD (UTC).
None

### Internal Improvements
- Improve live engines error logging (will now log all exceptions rather than just `RuntimeError`)
- Upgraded `datafusion` crate to v43.0.0 (#2056), thanks @twitu

### Breaking Changes
Expand Down
16 changes: 8 additions & 8 deletions nautilus_trader/live/data_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ async def _run_cmd_queue(self) -> None:
self._execute_command(command)
except asyncio.CancelledError:
self._log.warning("DataCommand message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "DataCommand message queue stopped"
if not self._cmd_queue.empty():
Expand All @@ -411,8 +411,8 @@ async def _run_req_queue(self) -> None:
self._handle_request(request)
except asyncio.CancelledError:
self._log.warning("DataRequest message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "DataRequest message queue stopped"
if not self._req_queue.empty():
Expand All @@ -432,8 +432,8 @@ async def _run_res_queue(self) -> None:
self._handle_response(response)
except asyncio.CancelledError:
self._log.warning("DataResponse message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "DataResponse message queue stopped"
if not self._res_queue.empty():
Expand All @@ -451,8 +451,8 @@ async def _run_data_queue(self) -> None:
self._handle_data(data)
except asyncio.CancelledError:
self._log.warning("Data message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "Data message queue stopped"
if not self._data_queue.empty():
Expand Down
8 changes: 4 additions & 4 deletions nautilus_trader/live/execution_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ async def _run_cmd_queue(self) -> None:
self._execute_command(command)
except asyncio.CancelledError:
self._log.warning("Command message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "Command message queue stopped"
if not self._cmd_queue.empty():
Expand All @@ -419,8 +419,8 @@ async def _run_evt_queue(self) -> None:
self._handle_event(event)
except asyncio.CancelledError:
self._log.warning("Event message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "Event message queue stopped"
if not self._evt_queue.empty():
Expand Down
8 changes: 4 additions & 4 deletions nautilus_trader/live/risk_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ async def _run_cmd_queue(self) -> None:
self._execute_command(command)
except asyncio.CancelledError:
self._log.warning("Command message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "Command message queue stopped"
if not self._cmd_queue.empty():
Expand All @@ -265,8 +265,8 @@ async def _run_evt_queue(self) -> None:
self._handle_event(event)
except asyncio.CancelledError:
self._log.warning("Event message queue canceled")
except RuntimeError as e:
self._log.error(f"RuntimeError: {e}")
except Exception as e:
self._log.error(repr(e))
finally:
stopped_msg = "Event message queue stopped"
if not self._evt_queue.empty():
Expand Down

0 comments on commit ae07595

Please sign in to comment.