From 0936bdc5922b8d594c8e6ef24c453461becd1ee7 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 20 Jul 2020 19:49:39 -0400 Subject: [PATCH] Add back subactor logging --- tractor/_entry.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tractor/_entry.py b/tractor/_entry.py index 62f7a1f..82f814c 100644 --- a/tractor/_entry.py +++ b/tractor/_entry.py @@ -57,7 +57,19 @@ async def _trio_main( accept_addr: Tuple[str, int], parent_addr: Tuple[str, int] = None ) -> None: + """Entry point for a `trio_run_in_process` subactor. + + Here we don't need to call `trio.run()` since trip does that as + part of its subprocess startup sequence. + """ + 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 new trio process for {actor.uid}") _state._current_actor = actor await actor._async_main(accept_addr, parent_addr=parent_addr) + log.info(f"Actor {actor.uid} terminated")