From 72099985be321a49a4211a85f1392197c17426c9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 11 Mar 2021 10:07:39 -0500 Subject: [PATCH] Add per actor debug mode toggle --- tractor/_trionics.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tractor/_trionics.py b/tractor/_trionics.py index 9ecb28d..6a522ec 100644 --- a/tractor/_trionics.py +++ b/tractor/_trionics.py @@ -62,6 +62,7 @@ class ActorNursery: loglevel: str = None, # set log level per subactor nursery: trio.Nursery = None, infect_asyncio: bool = False, + debug_mode: Optional[bool] = None, ) -> Portal: loglevel = loglevel or self._actor.loglevel or get_loglevel() @@ -69,6 +70,10 @@ class ActorNursery: _rtv = _state._runtime_vars.copy() _rtv['_is_root'] = False + # allow setting debug policy per actor + if debug_mode is not None: + _rtv['_debug_mode'] = debug_mode + enable_modules = enable_modules or [] if rpc_module_paths: