Skip to content

Add LogCapture class for testing #9617

@twisted-trac

Description

@twisted-trac
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions