forked from goodboy/tractor
`._entry`: use same msg info in start/terminate log
parent
c6b4da5788
commit
e536057fea
|
@ -116,14 +116,18 @@ def _trio_main(
|
|||
if actor.loglevel is not None:
|
||||
get_console_log(actor.loglevel)
|
||||
import os
|
||||
log.info(
|
||||
'Started new trio process:\n'
|
||||
actor_info: str = (
|
||||
f'|_{actor}\n'
|
||||
f' uid: {actor.uid}\n'
|
||||
f' pid: {os.getpid()}\n'
|
||||
f' parent_addr: {parent_addr}\n'
|
||||
f' loglevel: {actor.loglevel}\n'
|
||||
)
|
||||
log.info(
|
||||
'Started new trio process:\n'
|
||||
+
|
||||
actor_info
|
||||
)
|
||||
|
||||
try:
|
||||
if infect_asyncio:
|
||||
|
@ -133,8 +137,14 @@ def _trio_main(
|
|||
trio.run(trio_main)
|
||||
except KeyboardInterrupt:
|
||||
log.cancel(
|
||||
f'@{actor.uid} received KBI'
|
||||
'Actor received KBI\n'
|
||||
+
|
||||
actor_info
|
||||
)
|
||||
|
||||
finally:
|
||||
log.info(f"Actor {actor.uid} terminated")
|
||||
log.info(
|
||||
'Actor terminated\n'
|
||||
+
|
||||
actor_info
|
||||
)
|
||||
|
|
|
@ -342,7 +342,9 @@ async def open_root_actor(
|
|||
# for an in nurseries:
|
||||
# tempn.start_soon(an.exited.wait)
|
||||
|
||||
logger.cancel("Shutting down root actor")
|
||||
logger.info(
|
||||
'Closing down root actor'
|
||||
)
|
||||
await actor.cancel(None) # self cancel
|
||||
finally:
|
||||
_state._current_actor = None
|
||||
|
|
Loading…
Reference in New Issue