Add common logger instance for `.brokers`

rekt_pps
Tyler Goodlet 2023-03-22 12:28:33 -04:00
parent a462de6f2d
commit 2ae9576cd8
1 changed files with 17 additions and 3 deletions

View File

@ -15,13 +15,28 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
""" """
Handy utils. Handy cross-broker utils.
""" """
from functools import partial
import json import json
import asks import asks
import logging import logging
from ..log import colorize_json from ..log import (
get_logger,
get_console_log,
colorize_json,
)
subsys: str = 'piker.brokers'
log = get_logger(subsys)
get_console_log = partial(
get_console_log,
name=subsys,
)
class BrokerError(Exception): class BrokerError(Exception):
@ -69,7 +84,6 @@ class DataThrottle(BrokerError):
# TODO: add in throttle metrics/feedback # TODO: add in throttle metrics/feedback
def resproc( def resproc(
resp: asks.response_objects.Response, resp: asks.response_objects.Response,
log: logging.Logger, log: logging.Logger,