From 4c1d174801605f4c41fb4183e8e9d2b98d550922 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 4 Apr 2023 13:25:36 -0400 Subject: [PATCH] Expect `loglevel: str` in brokerd root task ep Set the level right after spawn and once for the lifetime of the daemon. --- piker/data/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/piker/data/__init__.py b/piker/data/__init__.py index 5c83150e..74eefb83 100644 --- a/piker/data/__init__.py +++ b/piker/data/__init__.py @@ -56,6 +56,7 @@ __all__ = [ async def _setup_persistent_brokerd( ctx: tractor.Context, brokername: str, + loglevel: str | None = None, ) -> None: ''' @@ -64,7 +65,9 @@ async def _setup_persistent_brokerd( the broker backend as needed. ''' - get_console_log(tractor.current_actor().loglevel) + get_console_log( + loglevel or tractor.current_actor().loglevel, + ) from .feed import ( _bus, @@ -84,5 +87,3 @@ async def _setup_persistent_brokerd( # we pin this task to keep the feeds manager active until the # parent actor decides to tear it down await trio.sleep_forever() - -