forked from goodboy/tractor
`get_loglevel()` always returns a str
parent
72eef2a4a1
commit
92c6ec1882
|
@ -87,11 +87,15 @@ async def open_root_actor(
|
|||
_default_arbiter_port,
|
||||
)
|
||||
|
||||
loglevel = loglevel or log.get_loglevel()
|
||||
if loglevel is not None:
|
||||
|
||||
if loglevel is None:
|
||||
loglevel = log.get_loglevel()
|
||||
else:
|
||||
log._default_loglevel = loglevel
|
||||
log.get_console_log(loglevel)
|
||||
|
||||
assert loglevel
|
||||
|
||||
if debug_mode and _spawn._spawn_method == 'trio':
|
||||
_state._runtime_vars['_debug_mode'] = True
|
||||
|
||||
|
@ -105,7 +109,7 @@ async def open_root_actor(
|
|||
logging.getLevelName(
|
||||
# lul, need the upper case for the -> int map?
|
||||
# sweet "dynamic function behaviour" stdlib...
|
||||
log.get_loglevel().upper()
|
||||
loglevel.upper()
|
||||
) > logging.getLevelName('PDB')
|
||||
):
|
||||
loglevel = 'PDB'
|
||||
|
|
|
@ -9,8 +9,8 @@ from typing import Optional
|
|||
from ._state import ActorContextInfo
|
||||
|
||||
|
||||
_proj_name = 'tractor'
|
||||
_default_loglevel = 'ERROR'
|
||||
_proj_name: str = 'tractor'
|
||||
_default_loglevel: str = 'ERROR'
|
||||
|
||||
# Super sexy formatting thanks to ``colorlog``.
|
||||
# (NOTE: we use the '{' format style)
|
||||
|
@ -189,5 +189,5 @@ def get_console_log(
|
|||
return log
|
||||
|
||||
|
||||
def get_loglevel() -> Optional[str]:
|
||||
def get_loglevel() -> str:
|
||||
return _default_loglevel
|
||||
|
|
Loading…
Reference in New Issue