From 4f69af872c9cf3c36c9126656ac5ff47d4262eae Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 29 Feb 2024 20:01:39 -0500 Subject: [PATCH] Add field-first subproca `.info()` to `._entry` --- tractor/_entry.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tractor/_entry.py b/tractor/_entry.py index b5ab405..4a1499a 100644 --- a/tractor/_entry.py +++ b/tractor/_entry.py @@ -106,25 +106,25 @@ def _trio_main( Entry point for a `trio_run_in_process` subactor. ''' - log.info(f"Started new trio process for {actor.uid}") - - if actor.loglevel is not None: - log.info( - f"Setting loglevel for {actor.uid} to {actor.loglevel}") - get_console_log(actor.loglevel) - - log.info( - f"Started {actor.uid}") - _state._current_actor = actor - - log.debug(f"parent_addr is {parent_addr}") trio_main = partial( async_main, actor, parent_addr=parent_addr ) + if actor.loglevel is not None: + get_console_log(actor.loglevel) + import os + log.info( + 'Started new trio process:\n' + f'|_{actor}\n' + f' uid: {actor.uid}\n' + f' pid: {os.getpid()}\n' + f' parent_addr: {parent_addr}\n' + f' loglevel: {actor.loglevel}\n' + ) + try: if infect_asyncio: actor._infected_aio = True @@ -133,7 +133,7 @@ def _trio_main( trio.run(trio_main) except KeyboardInterrupt: log.cancel( - f'Actor@{actor.uid} received KBI' + f'@{actor.uid} received KBI' ) finally: