From 418c6907fde313ebd1801af884f10e5fbb1178fd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 14 Jun 2024 15:37:57 -0400 Subject: [PATCH] Add `enable_stack_on_sig: bool` for `stackscope` toggle --- tractor/_root.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tractor/_root.py b/tractor/_root.py index 203627d..7cdef60 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -80,6 +80,7 @@ async def open_root_actor( # enables the multi-process debugger support debug_mode: bool = False, maybe_enable_greenback: bool = False, # `.pause_from_sync()/breakpoint()` support + enable_stack_on_sig: bool = False, # internal logging loglevel: str|None = None, @@ -220,7 +221,11 @@ async def open_root_actor( assert _log # TODO: factor this into `.devx._stackscope`!! - if debug_mode: + if ( + debug_mode + and + enable_stack_on_sig + ): try: logger.info('Enabling `stackscope` traces on SIGUSR1') from .devx import enable_stack_on_sig