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

tests: use buffer instead of capturer to test logger output #476

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

Hamsajj
Copy link
Contributor

@Hamsajj Hamsajj commented Mar 4, 2024

Ticket(s)

addresses #457

Description

Adds the option to write logger console output to a custom io.Writer. This helps with the tests that directly test the logger. Also, enables the use of cobra cmd.Print instead of plain os.Stdout for the logger to help with tests using executeC and root.SetOut.

Development Checklist

  • I have added a descriptive title to this PR.
  • I have squashed related commits together.
  • I have rebased my branch on top of the latest main branch.
  • I have performed a self-review of my own code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added docstring(s) to my code.
  • I have made corresponding changes to the documentation (docs).
  • I have added tests for my changes.
  • I have signed all the commits.

Legal Checklist

Copy link
Member

@mostafa mostafa left a comment

Choose a reason for hiding this comment

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

Hey @Hamsajj,

Thanks for your contribution! 🙏

@mostafa mostafa linked an issue Mar 4, 2024 that may be closed by this pull request
@mostafa mostafa merged commit 5795390 into gatewayd-io:main Mar 4, 2024
4 checks passed
@mostafa mostafa mentioned this pull request Mar 5, 2024
13 tasks
smnmna99 pushed a commit that referenced this pull request Mar 13, 2024
* tests: use buffer instead of capturer to test logger output
* Fix plugin url in tests

---------

Co-authored-by: Mostafa Moradian <[email protected]>
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.

Replace go-capturer with logging to buffer
2 participants