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

Fix custom log level manipulation and isolate logger unit tests #721

Merged

Conversation

ericmustin
Copy link
Contributor

Addressing #681 , a custom logger's log level can be unintentionally changed by Tracer configuration, which I was able to recreate locally.

  • Per suggestion this PR adds a check in self.debug_logging assignment for whether the custom logger is an instance of the Datadog::Logger class and is a noop if debug logging is not enabled
  • Adds a unit test in test/logger_test.rb for new behavior.
  • While I was in there I noticed the logger unit tests could be isolated a bit more, as failed assertions would cause some of the teardown code at the end of each unit test to not get called. Following some of the conventions used in other tests, this PR also adds setup and teardown helpers for logger_test.rb.

Thanks for taking a look! Happy to address any feedback or anything else you think might be relevant here.

@ericmustin ericmustin added core Involves Datadog core libraries community Was opened by a community member labels Mar 17, 2019
@delner delner changed the base branch from master to 0.21-dev March 20, 2019 16:26
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

@ericmustin Thanks for the contribution! Looks good overall. We're in the process of converting those minitests to RSpec, where I think the teardown issue you ran into won't be such a factor.

Going to merge and release this with 0.21.0. 🎉

@delner delner merged commit 0b224f4 into DataDog:0.21-dev Mar 20, 2019
@delner delner added this to the 0.21.0 milestone Mar 20, 2019
@ericmustin ericmustin deleted the issue_681_fix_custom_log_level_override branch August 10, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Was opened by a community member core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants