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

Add LogCapture class for testing #9617

Closed
twisted-trac opened this issue Apr 8, 2019 · 6 comments
Closed

Add LogCapture class for testing #9617

twisted-trac opened this issue Apr 8, 2019 · 6 comments

Comments

@twisted-trac
Copy link

wsanchez's avatar @wsanchez reported
Trac ID trac#9617
Type enhancement
Created 2019-04-08 19:13:29Z
Branch https://github.com/twisted/twisted/tree/log-capture2

Add a context manager for capturing logs emitted via the twisted.logger API.

The idea comes from Adi via #8036.

I've simplified the class a wee bit, and make asText() a method that generates the text on demand, since I think that poking at the actual events is probably enough for most test cases.

Searchable metadata
trac-id__9617 9617
type__enhancement enhancement
reporter__wsanchez wsanchez
priority__normal normal
milestone__None None
branch__log_capture2 log-capture2
branch_author__ 
status__closed closed
resolution__fixed fixed
component__logger logger
keywords__None None
time__1554750809700727 1554750809700727
changetime__1555092238361101 1555092238361101
version__None None
owner__None None
cc__adiroiban
@twisted-trac
Copy link
Author

glyph's avatar @glyph commented

#1127

@twisted-trac
Copy link
Author

glyph's avatar @glyph set owner to @wsanchez

Thanks for adding this much-needed and oft-reimplemented utility! Can't wait to standardize on the official Twisted one.

@twisted-trac
Copy link
Author

wsanchez's avatar @wsanchez removed owner

@twisted-trac
Copy link
Author

wsanchez's avatar @wsanchez commented

Prior review comments from Glyph addressed.

@twisted-trac
Copy link
Author

wsanchez's avatar @wsanchez set status to closed

@twisted-trac
Copy link
Author

wsanchez's avatar @wsanchez commented

(Reviewer was Adi in GH)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant