Skip to content

String handler

string_handler

Module for handling basic logging by streaming into StringIO.

StringStreamHandler

Class for logging via StringIO.

__init__

__init__() -> StringStreamHandler

Init a StringStreamHandler.

handle

handle(record: LogRecord) -> bool

Conditionally emit the specified logging record.

Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns whether the filter passed the record for emission.

readlines

readlines(hint: int = -1) -> list[str]

Reads lines from stream and returns them.

seek_start

seek_start() -> None

Seeks to a specific point in the stream.

seek_end

seek_end() -> None

Seeks to the end of the stream.

seek

seek(offset: int, whence: int) -> int

Seek to a specific point in the stream.