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

Chore: Allow logger to be overridden #57

Merged
merged 1 commit into from
Jun 22, 2022
Merged

Chore: Allow logger to be overridden #57

merged 1 commit into from
Jun 22, 2022

Conversation

marefr
Copy link
Member

@marefr marefr commented Jun 22, 2022

By assigning backend.Logger to a variable it makes it impossible to override the logger implementation when grafana-aws-sdk is used in Grafana itself for the core CloudWatch datasource. This removes the assignment of backend.Logger to a variable.

@CLAassistant
Copy link

CLAassistant commented Jun 22, 2022

CLA assistant check
All committers have signed the CLA.

@marefr marefr self-assigned this Jun 22, 2022
Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

LGTM

t.Cleanup(func() {
plog = origLogger
backend.Logger = origLogger
Copy link
Contributor

Choose a reason for hiding this comment

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

I am surprised you can mock an exported variable like this but the tests are passing so it should be fine 👍

Copy link
Member

@wbrowne wbrowne left a comment

Choose a reason for hiding this comment

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

😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants