From af01e8961249b5b8cb26fef9c54ffc3c067db534 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 5 Jul 2022 16:59:47 -0400 Subject: [PATCH] Create sub-pkg logger once during import --- piker/brokers/kraken/__init__.py | 6 ++++++ piker/brokers/kraken/api.py | 4 +--- piker/brokers/kraken/broker.py | 2 +- piker/brokers/kraken/feed.py | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/piker/brokers/kraken/__init__.py b/piker/brokers/kraken/__init__.py index 013da8fd..cd36f4e5 100644 --- a/piker/brokers/kraken/__init__.py +++ b/piker/brokers/kraken/__init__.py @@ -25,6 +25,11 @@ Sub-modules within break into the core functionalities: wrapping around ``ib_insync``. ''' + +from piker.log import get_logger + +log = get_logger(__name__) + from .api import ( get_client, ) @@ -44,6 +49,7 @@ __all__ = [ 'open_history_client', 'open_symbol_search', 'stream_quotes', + 'norm_trade_records', ] diff --git a/piker/brokers/kraken/api.py b/piker/brokers/kraken/api.py index fa167cf4..3abf533e 100644 --- a/piker/brokers/kraken/api.py +++ b/piker/brokers/kraken/api.py @@ -48,9 +48,7 @@ from piker.brokers._util import ( BrokerError, DataThrottle, ) -from piker.log import get_logger - -log = get_logger(__name__) +from . import log # // _url = 'https://api.kraken.com/0' diff --git a/piker/brokers/kraken/broker.py b/piker/brokers/kraken/broker.py index 433c058b..4e2e02f6 100644 --- a/piker/brokers/kraken/broker.py +++ b/piker/brokers/kraken/broker.py @@ -47,11 +47,11 @@ from piker.clearing._messages import ( BrokerdPosition, BrokerdStatus, ) +from . import log from .api import ( Client, BrokerError, get_client, - log, normalize_symbol, ) from .feed import ( diff --git a/piker/brokers/kraken/feed.py b/piker/brokers/kraken/feed.py index 5742bcb1..71b75082 100644 --- a/piker/brokers/kraken/feed.py +++ b/piker/brokers/kraken/feed.py @@ -46,9 +46,9 @@ from piker.brokers._util import ( from piker.log import get_console_log from piker.data import ShmArray from piker.data._web_bs import open_autorecon_ws, NoBsWs +from . import log from .api import ( Client, - log, OHLC, )