diff --git a/tractor/_debug.py b/tractor/_debug.py index c1b1832..c76422a 100644 --- a/tractor/_debug.py +++ b/tractor/_debug.py @@ -276,7 +276,7 @@ def _set_trace(actor=None): pdb = _mk_pdb() if actor is not None: - log.runtime(f"\nAttaching pdb to actor: {actor.uid}\n") + log.pdb(f"\nAttaching pdb to actor: {actor.uid}\n") pdb.set_trace( # start 2 levels up in user code @@ -306,7 +306,7 @@ breakpoint = partial( def _post_mortem(actor): - log.runtime(f"\nAttaching to pdb in crashed actor: {actor.uid}\n") + log.pdb(f"\nAttaching to pdb in crashed actor: {actor.uid}\n") pdb = _mk_pdb() # custom Pdb post-mortem entry diff --git a/tractor/_root.py b/tractor/_root.py index da4ba68..8391f4c 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -86,6 +86,9 @@ async def open_root_actor( # for use of ``await tractor.breakpoint()`` enable_modules.append('tractor._debug') + if loglevel is None: + loglevel = 'pdb' + elif debug_mode: raise RuntimeError( "Debug mode is only supported for the `trio` backend!"