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

Cherry-pick #15700 to 7.x: Split global and normal logger tests #15825

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

urso
Copy link

@urso urso commented Jan 24, 2020

Cherry-pick of PR #15700 to 7.x branch. Original message:

What does this PR do?

Move logp global functions to global.go and selective.go, plus split up
tests. The change also adds the nologpglobal build tag to global.go and global_test.go.
By default all global functions are available. When compiling or
running a package its test code with -tags=nologpglobal, then global
logp functions are not available.

Why is it important?

In order to better support structured logging in Beats we want to remove global logging functions. See #15699

This PR adds a build tag that can be used to check for packages that need to be cleaned up. When running go build -tags=nologpglobal or go test -tags=nologpglobal on a selected package, the compiler will fail until the package and its transitive dependencies have been cleaned up.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

lgtm

Move logp global functions to global.go and selective.go, plus split up
tests. The change also adds the `nologpglobal` build tag to global.go and global_test.go.
By default all global functions are available. When compiling or
running a package its test code with `-tags=nologpglobal`, then global
logp functions are not available.

(cherry picked from commit 4183ba3)
@urso urso force-pushed the backport_15700_7.x branch from 4f07bd9 to 76a119a Compare January 28, 2020 20:27
@urso urso merged commit 958f7c9 into elastic:7.x Jan 28, 2020
@urso urso deleted the backport_15700_7.x branch January 28, 2020 23:02
@andresrc andresrc added the Team:Integrations Label for the Integrations team label Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants