File format: MAGIC || NONCE || TAG || CIPHERTEXT
(src_fp, dst_path: str)
| 439 | with _TERMUX_ERROR_LOCK: |
| 440 | if _TERMUX_ERROR_MONITOR_ACTIVE: |
| 441 | sys.stderr.write("\n[ButSystem ERROR] " + rendered + "\n") |
| 442 | sys.stderr.flush() |
| 443 | else: |
| 444 | _TERMUX_ERROR_BUFFER.append(rendered) |
| 445 | del _TERMUX_ERROR_BUFFER[:-50] |
| 446 | except Exception: |
| 447 | pass |
| 448 | |
| 449 | |
| 450 | _TERMUX_ERROR_HANDLER = _TermuxErrorBufferHandler() |
| 451 | logging.getLogger().addHandler(_TERMUX_ERROR_HANDLER) |
| 452 | |
| 453 | |
| 454 | def _activate_termux_error_monitor(): |
| 455 | """Print buffered errors and stream new errors below the generated links.""" |
| 456 | global _TERMUX_ERROR_MONITOR_ACTIVE |
| 457 | with _TERMUX_ERROR_LOCK: |
| 458 | _TERMUX_ERROR_MONITOR_ACTIVE = True |
| 459 | buffered = list(_TERMUX_ERROR_BUFFER) |
| 460 | _TERMUX_ERROR_BUFFER.clear() |
| 461 | print("ERROR MONITOR: New application errors will appear below this line.") |
| 462 | if buffered: |
| 463 | print(f"STARTUP ERRORS FOUND: {len(buffered)}") |
| 464 | for item in buffered: |
| 465 | print("\n[ButSystem ERROR] " + item) |
no test coverage detected