(self, buf: str)
| 15 | self.linebuf = "" |
| 16 | |
| 17 | def write(self, buf: str): |
| 18 | try: |
| 19 | temp_linebuf = self.linebuf + buf |
| 20 | self.linebuf = "" |
| 21 | for line in temp_linebuf.splitlines(True): |
| 22 | if line.endswith(("\n", "\r")): |
| 23 | self.logger.log(self.log_level, line.rstrip()) |
| 24 | else: |
| 25 | self.linebuf += line |
| 26 | except Exception as e: |
| 27 | print(f"StreamToLogger Error: {e}", file=sys.__stderr__) |
| 28 | |
| 29 | def flush(self): |
| 30 | try: |
no outgoing calls