-
Notifications
You must be signed in to change notification settings - Fork 48
[logp/logptest] Add logptest.Logger #362
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
Conversation
This commit adds logptest.Logger, a logger meant to be used on tests, its key features: - All logs are saved on a single temporary log file - On failures, the log file is kept and its path printed - Methods to search and wait for log entries are provided, they keep track of the offset, ensuring ordering when when searching for logs
orestisfl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also export both t-based and non-t-based functions for users that do not want to fail their tests for non-matching logs. E.g. we might want to test that logs do NOT contain something
|
I'm currently refactoring the beats receivers test suite and this logger will come in handy, thanks! |
Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
💚 Build Succeeded
History
cc @belimawr |
What does this PR do?
This PR adds logptest.Logger, a logger meant to be used on tests, its key features:
Why is it important?
It adds a logger to be used in tests with some helper functions
Checklist
I have added tests that prove my fix is effective or that my feature works## Author's Checklist## Related issues