Definition at line 145 of file logcapture.py.
Public Member Functions | |
| __init__ (self, *, LogLevel log_level, collections.abc.Callable[[bytes], dict] parse_line) | |
| Capture server. | |
| LogLevel | default_log_level (self) |
| Returns default log level specified on object creation. | |
| list[tuple] | getsocknames (self) |
| Return list of server socket names. | |
| typing.AsyncIterator[ 'CaptureServer'] | start (self, host='localhost', port=0, **kwargs) |
| Starts capture logs asyncio server. | |
| wait_for_client (self, float timeout=10.0) | |
| Waits for logserver client to connect. | |
| typing.AsyncIterator[Capture] | capture (self, *, LogLevel|None log_level=None, float timeout=10.0) |
| Starts logs capture. | |
Protected Member Functions | |
| _handle_client (self, reader, writer) | |
Protected Attributes | |
| _log_level = log_level | |
| _client_cond = asyncio.Condition() | |
| list | _tasks = [] |
| _parse_line = parse_line | |
| bool | _started = False |
| list | _socknames = [] |
Static Protected Attributes | |
| CapturedLogs | _capture | None |
| testsuite.logcapture.CaptureServer.__init__ | ( | self, | |
| * | , | ||
| LogLevel | log_level, | ||
| collections.abc.Callable[[bytes], dict] | parse_line ) |
Capture server.
Definition at line 148 of file logcapture.py.
|
protected |
Definition at line 213 of file logcapture.py.
| LogLevel testsuite.logcapture.CaptureServer.default_log_level | ( | self | ) |
Returns default log level specified on object creation.
Definition at line 164 of file logcapture.py.
| list[tuple] testsuite.logcapture.CaptureServer.getsocknames | ( | self | ) |
Return list of server socket names.
Definition at line 168 of file logcapture.py.
| typing.AsyncIterator['CaptureServer'] testsuite.logcapture.CaptureServer.start | ( | self, | |
| host = 'localhost', | |||
| port = 0, | |||
| ** | kwargs ) |
Starts capture logs asyncio server.
Arguments are directly passed to asyncio.start_server. Server could be started only once. Capture server is returned. Server is closed when contextmanager is finished.
Definition at line 173 of file logcapture.py.
| testsuite.logcapture.CaptureServer.wait_for_client | ( | self, | |
| float | timeout = 10.0 ) |
Waits for logserver client to connect.
Definition at line 198 of file logcapture.py.
|
staticprotected |
Definition at line 146 of file logcapture.py.
|
protected |
Definition at line 156 of file logcapture.py.
|
protected |
Definition at line 155 of file logcapture.py.
|
protected |
Definition at line 159 of file logcapture.py.
|
protected |
Definition at line 161 of file logcapture.py.
|
protected |
Definition at line 160 of file logcapture.py.
|
protected |
Definition at line 158 of file logcapture.py.