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

Use dedicated instance logger for connection messages #9887

Merged
merged 1 commit into from
Aug 12, 2021
Merged

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Aug 12, 2021

Motivation

Add ability to disambiguate, see:

2021-08-11 10:29:17 UTC | CORE | DEBUG | (pkg/collector/python/datadog_agent.go:126 in LogMessage) | - | (connection.py:53) | connecting without a username and password

vs:

2021-08-11 10:29:23 UTC | CORE | DEBUG | (pkg/collector/python/datadog_agent.go:126 in LogMessage) | ibm_mq:f53004b96cb7511a | (ibm_mq.py:86) | Could not retrieve ibm_mq version info

@ofek ofek requested a review from a team as a code owner August 12, 2021 14:54
@ghost ghost added the integration/ibm_mq label Aug 12, 2021
@codecov
Copy link

codecov bot commented Aug 12, 2021

Codecov Report

Merging #9887 (675abc2) into master (4c7725c) will decrease coverage by 0.00%.
The diff coverage is 87.50%.

Flag Coverage Δ
ibm_mq 89.84% <87.50%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

import pymqi

logger = logging.getLogger(__file__)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really a suggestion, but wanted to check my understanding: Is the python logging package being used here instead of the dedicated check instance logger because this is a unit test against the check? Since the the check's methods now expect a logger argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, yeah we don't type check tests/ afaik & was easier to do this than creating a check instance just for the logger

Copy link
Contributor

@fanny-jiang fanny-jiang left a comment

Choose a reason for hiding this comment

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

👍

@ofek ofek merged commit a5df8c5 into master Aug 12, 2021
@ofek ofek deleted the ofek/mql branch August 12, 2021 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants