-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[logging] rename loggers and set handlers to null #161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few 🔥 /cleaning comments.
@@ -8,7 +8,7 @@ | |||
from datadog.api.api_client import APIClient | |||
|
|||
|
|||
log = logging.getLogger('dd.datadogpy') | |||
log = logging.getLogger('datadog.api') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used, 🔥 ?
@@ -9,7 +9,7 @@ | |||
# CONSTANTS | |||
DATADOG_CONF = "datadog.conf" | |||
|
|||
log = logging.getLogger('dd.datadogpy') | |||
log = logging.getLogger('datadog.api') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used, 🔥 ?
@@ -22,6 +23,10 @@ | |||
|
|||
__version__ = get_version() | |||
|
|||
# Loggers | |||
logging.getLogger('datadog.api').addHandler(logging.NullHandler()) | |||
logging.getLogger('datadog.dogstatsd').addHandler(logging.NullHandler()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about datadog.threadstats
?
Split `dd.datadogpy` logger to one per module, i.e. * `datadog.api` * `datadog.dogstatsd` * `datadog.threadstats` Setup the `NullHandler` handler by default as advised in https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
60f1004
to
8f5f29c
Compare
Fix #161 |
Split
dd.datadogpy
logger to one per module, i.e.datadog.api
datadog.dogstatsd
datadog.threadstats
Setup the
NullHandler
handler by default as advised inhttps://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library