Skip to content
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

Merged
merged 1 commit into from
Sep 21, 2016

Conversation

yannmh
Copy link
Member

@yannmh yannmh commented Sep 21, 2016

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

Copy link
Member

@degemer degemer left a 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')
Copy link
Member

@degemer degemer Sep 21, 2016

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')
Copy link
Member

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())
Copy link
Member

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
@yannmh
Copy link
Member Author

yannmh commented Sep 21, 2016

Fix #161

@yannmh yannmh merged commit 7e47fae into master Sep 21, 2016
@yannmh yannmh deleted the yann/logging-null-handler branch September 21, 2016 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants