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

Don't log the deprecation debug messages in production #17824

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

bdunne
Copy link
Member

@bdunne bdunne commented Aug 9, 2018

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1609905

Deprecation warning debug messages aren't so helpful in production and add a lot more noise to the logs.

@miq-bot
Copy link
Member

miq-bot commented Aug 9, 2018

Checked commit bdunne@df146c8 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@carbonin carbonin self-assigned this Aug 9, 2018
@carbonin carbonin merged commit 3790c5b into ManageIQ:master Aug 9, 2018
@carbonin carbonin added this to the Sprint 92 Ending Aug 13, 2018 milestone Aug 9, 2018
@@ -30,7 +30,7 @@ def self.proc_for_default_log
return unless default_log
proc do |message, callstack|
default_log.warn(message)
default_log.debug(callstack.join("\n ")) if default_log.debug?
Copy link
Member

Choose a reason for hiding this comment

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

WAT. We were calling debug on the logger after first checking if it was debug? We were trying to avoid the unnecessary string allocations in the case of info log level? I vaguely recall you can pass a block to accomplish the same thing.

Copy link
Member

Choose a reason for hiding this comment

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

in other words...

default_log.debug { callstack.join("\n  ") }

Or something like that... either way, I like the change... in dev and test mode, we don't care about the allocations.

@bdunne bdunne deleted the deprecation_warnings branch August 10, 2018 12:49
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.

4 participants