Skip to content

Commit

Permalink
core: ardupilot_manager: AbstractRouter: Improve debug message with r…
Browse files Browse the repository at this point in the history
…outer name

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Jan 30, 2025
1 parent 273f5cb commit b8e0762
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def start(self, master_endpoint: Endpoint) -> None:
stderr = _strerr.decode("utf-8") if _strerr else "No stderr."
output = f"message: stdout: '{stdout}', stderr: '{stderr}'"
returncode = self._subprocess.returncode
raise MavlinkRouterStartFail(f"Failed to initialize Mavlink router, code: {returncode}, {output}")
raise MavlinkRouterStartFail(f"Failed to initialize {self.name()}, code: {returncode}, {output}")
await self.start_house_keepers()

async def exit(self) -> None:
Expand All @@ -127,7 +127,7 @@ async def exit(self) -> None:
await asyncio.sleep(3)
await self._subprocess.wait() # Wait for the subprocess to terminate
else:
logger.debug("Tried to stop router, but it was already not running.")
logger.debug(f"Tried to stop {self.name()}, but it was already not running.")

async def start_house_keepers(self) -> None:
if self._subprocess is None:
Expand Down Expand Up @@ -158,7 +158,7 @@ async def _log_stderr(self) -> None:

async def restart(self) -> None:
if self._master_endpoint is None:
raise NoMasterMavlinkEndpoint("Mavlink master endpoint was not set. Cannot restart router.")
raise NoMasterMavlinkEndpoint(f"Mavlink master endpoint was not set. Cannot restart {self.name()}.")
await self.exit()
await self.start(self._master_endpoint)

Expand Down

0 comments on commit b8e0762

Please sign in to comment.