Spaces:
Running
Running
sync: upstream 9194f15 + custom addons (KeyRotator, RotatingChatTransport, sol/terra/luna, ScannerTrap, health, Py3.12 compat)
e99df76 Download src/free_claude_code/messaging/safe_diagnostics.py from dherain24/claude-proxy: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/src/free_claude_code/messaging/safe_diagnostics.py
- Command line
-
hf download hf://spaces/dherain24/claude-proxy/src/free_claude_code/messaging/safe_diagnostics.py
-
curl -L -o safe_diagnostics.py https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/src/free_claude_code/messaging/safe_diagnostics.py
543 Bytes
| from __future__ import annotations | |
| """Helpers for redacting user-derived content from log lines.""" | |
| def format_exception_for_log(exc: BaseException, *, log_full_message: bool) -> str: | |
| """Return exception type and optionally ``str(exc)`` for operator diagnostics.""" | |
| if log_full_message: | |
| return f"{type(exc).__name__}: {exc}" | |
| return type(exc).__name__ | |
| def text_len_hint(text: str | None) -> int: | |
| """Length of text for metadata-only logging (0 when missing).""" | |
| if not text: | |
| return 0 | |
| return len(text) | |