From 8ffa6a5e68be0267ff2760a0107480a9b3a87932 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 6 May 2024 13:12:44 -0400 Subject: [PATCH] "Icons" in `._entry`'s subactor `.info()` messages Add a little `>` or `X` supervision icon indicating the spawning or termination of each sub-actor respectively. --- tractor/_entry.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tractor/_entry.py b/tractor/_entry.py index 78f8328..750dc59 100644 --- a/tractor/_entry.py +++ b/tractor/_entry.py @@ -20,6 +20,7 @@ Sub-process entry points. """ from __future__ import annotations from functools import partial +# import textwrap from typing import ( Any, TYPE_CHECKING, @@ -91,7 +92,7 @@ def _mp_main( pass # handle it the same way trio does? finally: - log.info(f"Actor {actor.uid} terminated") + log.info(f"Subactor {actor.uid} terminated") def _trio_main( @@ -125,9 +126,11 @@ def _trio_main( f' loglevel: {actor.loglevel}\n' ) log.info( - 'Started new trio process:\n' + 'Started new trio subactor:\n' + - actor_info + '>\n' # like a "started/play"-icon from super perspective + + + actor_info, ) try: @@ -148,5 +151,7 @@ def _trio_main( log.info( 'Subactor terminated\n' + + 'x\n' # like a "crossed-out/killed" from super perspective + + actor_info )