Skip to content

Conversation

@kruskall
Copy link
Member

@kruskall kruskall commented Aug 1, 2025

What does this PR do?

properly use zaptest logger instead of rewrapping the zap core

Why is it important?

this should make full use of zaptest logger and only log if a test fails

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

Related issues

properly use zaptest logger instead of rewrapping the zap core

this should make full use of zaptest logger and only log
if a test fails
@kruskall kruskall requested a review from a team as a code owner August 1, 2025 01:52
@kruskall kruskall requested review from khushijain21 and leehinman and removed request for a team August 1, 2025 01:52
kruskall and others added 2 commits August 4, 2025 12:20
@kruskall kruskall requested a review from AndersonQ August 4, 2025 10:21
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@belimawr belimawr self-requested a review August 4, 2025 11:35
Copy link
Contributor

@belimawr belimawr left a comment

Choose a reason for hiding this comment

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

LGTM

The only thing I'd add is to better document the modified/added functions to describe the behaviour of this log in a test scenario. Explaining if/when it will send logs to stdout/err, etc.

NewTestingLogger returns a testing suitable logp.Logger.

Does not explain what is the behaviour of 'suitable testing logger'.

Copy link
Member

@mauri870 mauri870 left a comment

Choose a reason for hiding this comment

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

LGTM. The new constructor that also returns an observer is a very welcome addition!

@kruskall
Copy link
Member Author

kruskall commented Aug 4, 2025

NewTestingLogger returns a testing suitable logp.Logger.

Does not explain what is the behaviour of 'suitable testing logger'.

I'm conflicted about this, it's an implementation but I have no strong opinion, happy to add it if there's consensus

@kruskall kruskall merged commit 531c756 into elastic:main Aug 4, 2025
1 of 5 checks passed
@kruskall kruskall deleted the feat/rework-zaptest branch August 4, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants