diff --git a/tractor/_root.py b/tractor/_root.py index c5b8f17..f8305ee 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -104,6 +104,8 @@ async def open_root_actor( ) + loglevel = (loglevel or log._default_loglevel).upper() + if debug_mode and _spawn._spawn_method == 'trio': _state._runtime_vars['_debug_mode'] = True @@ -117,7 +119,7 @@ async def open_root_actor( logging.getLevelName( # lul, need the upper case for the -> int map? # sweet "dynamic function behaviour" stdlib... - loglevel.upper() if loglevel else loglevel, + loglevel, ) > logging.getLevelName('PDB') ): loglevel = 'PDB' @@ -127,7 +129,6 @@ async def open_root_actor( "Debug mode is only supported for the `trio` backend!" ) - loglevel = (loglevel or log._default_loglevel).upper() log.get_console_log(loglevel) # make a temporary connection to see if an arbiter exists