Skip to content

Commit f1f2861

Browse files
committed
Log the full actor name when restarting
The actor `name` is really just a unique ID, and lacks the class name. For logging is best to use the `str`, which includes both the class name and the ID. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent f6f345f commit f1f2861

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/frequenz/sdk/actor/_actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async def _run_loop(self) -> None:
9999
limit_str = f"({n_restarts}/{limit_str})"
100100
if self._restart_limit is None or n_restarts < self._restart_limit:
101101
n_restarts += 1
102-
_logger.info("Actor %s: Restarting %s...", self._name, limit_str)
102+
_logger.info("Actor %s: Restarting %s...", self, limit_str)
103103
continue
104104
_logger.info(
105105
"Actor %s: Maximum restarts attempted %s, bailing out...",

tests/actor/test_actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ async def test_restart_on_unhandled_exception(
245245
),
246246
(
247247
*ACTOR_INFO,
248-
f"Actor test: Restarting ({i}/{restart_limit})...",
248+
f"Actor RaiseExceptionActor[test]: Restarting ({i}/{restart_limit})...",
249249
),
250250
(
251251
*ACTOR_INFO,

0 commit comments

Comments
 (0)