(self, prio, tag, original=None, **kwargs)
| 35 | |
| 36 | class TextLogStream(io.TextIOWrapper): |
| 37 | def __init__(self, prio, tag, original=None, **kwargs): |
| 38 | # Respect the -u option. |
| 39 | if original: |
| 40 | kwargs.setdefault("write_through", original.write_through) |
| 41 | fileno = original.fileno() |
| 42 | else: |
| 43 | fileno = None |
| 44 | |
| 45 | # The default is surrogateescape for stdout and backslashreplace for |
| 46 | # stderr, but in the context of an Android log, readability is more |
| 47 | # important than reversibility. |
| 48 | kwargs.setdefault("encoding", "UTF-8") |
| 49 | kwargs.setdefault("errors", "backslashreplace") |
| 50 | |
| 51 | super().__init__(BinaryLogStream(prio, tag, fileno), **kwargs) |
| 52 | self._lock = RLock() |
| 53 | self._pending_bytes = [] |
| 54 | self._pending_bytes_count = 0 |
| 55 | |
| 56 | def __repr__(self): |
| 57 | return f"<TextLogStream {self.buffer.tag!r}>" |
nothing calls this directly
no test coverage detected