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

New TestWriter for logging to testing.TB #369

Merged
merged 4 commits into from Oct 4, 2021
Merged

Conversation

emcfarlane
Copy link
Contributor

Implements a writer to wrap testing.TB for help in testing, #368.

The go testing log injects the callers filename and line number, which is incorrect for deeply nested functions. To get around this we allow to specify the frame depth and rewrite it. Not necessary but makes it pretty. Added an option for the ConsoleWriter to set the correct frame (although it's brittle to rewrites, not sure how to test better).

Implements a writer to wrap testing.TB for help in testing.
writer.go Outdated Show resolved Hide resolved
writer.go Show resolved Hide resolved
writer.go Outdated Show resolved Hide resolved
writer.go Outdated Show resolved Hide resolved
@rs rs merged commit 78448ee into rs:master Oct 4, 2021
@emcfarlane emcfarlane deleted the zerotest branch March 7, 2022 02:52
pablitoc pushed a commit to nxcr-org/zerolog that referenced this pull request Apr 7, 2023
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.

None yet

2 participants