Skip to content

[logging] rename loggers and set handlers to null#161

Merged
yannmh merged 1 commit intomasterfrom
yann/logging-null-handler
Sep 21, 2016
Merged

[logging] rename loggers and set handlers to null#161
yannmh merged 1 commit intomasterfrom
yann/logging-null-handler

Conversation

@yannmh
Copy link
Copy Markdown

@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
Copy Markdown
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.



log = logging.getLogger('dd.datadogpy')
log = logging.getLogger('datadog.api')
Copy link
Copy Markdown
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, 🔥 ?

DATADOG_CONF = "datadog.conf"

log = logging.getLogger('dd.datadogpy')
log = logging.getLogger('datadog.api')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used, 🔥 ?


# Loggers
logging.getLogger('datadog.api').addHandler(logging.NullHandler())
logging.getLogger('datadog.dogstatsd').addHandler(logging.NullHandler())
Copy link
Copy Markdown
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 yannmh force-pushed the yann/logging-null-handler branch from 60f1004 to 8f5f29c Compare September 21, 2016 19:50
@yannmh
Copy link
Copy Markdown
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