diff --git a/HISTORY.rst b/HISTORY.rst index fe3ecb7..cbfc180 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,13 @@ History ======= +v0.9.0 (2020-11-17) +----------------------- + +* Set logger.propogate to False after adding handler. +* Remove use_ddtrace logic from DatadogLogger. + + v0.8.5 (2020-11-11) ----------------------- diff --git a/aioradio/logger.py b/aioradio/logger.py index 9547b82..098b06f 100644 --- a/aioradio/logger.py +++ b/aioradio/logger.py @@ -2,16 +2,12 @@ for cleaner datadog logging.''' # pylint: disable=too-few-public-methods -# pylint: disable=too-many-arguments -# pylint: disable=too-many-instance-attributes import logging -import os import sys from datetime import datetime from typing import List -from ddtrace import tracer from pythonjsonlogger import jsonlogger @@ -45,8 +41,7 @@ def __init__( main_logger='', datadog_loggers=List[str], log_level=logging.INFO, - log_format="%(timestamp)d %(level)d %(name)d %(message)d", - use_ddtrace=True + log_format="%(timestamp)d %(level)d %(name)d %(message)d" ): self.logger = logging.getLogger(main_logger) @@ -54,13 +49,6 @@ def __init__( self.log_level = log_level self.datadog_loggers = set(datadog_loggers) if datadog_loggers else [] self.format = log_format - - if use_ddtrace: - tracer.configure( - hostname=os.getenv('DD_AGENT_HOST', ''), - port=os.getenv('DD_TRACE_AGENT_PORT', '') - ) - self.add_handlers() def add_handlers(self): @@ -73,3 +61,4 @@ def add_handlers(self): handler.setLevel(self.log_level) handler.setFormatter(formatter) logger.addHandler(handler) + logger.propagate = False diff --git a/setup.py b/setup.py index aa746f8..6b99eab 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ long_description = fileobj.read() setup(name='aioradio', - version='0.8.5', + version='0.9.0', description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more', long_description=long_description, long_description_content_type="text/markdown",