fix(ui): suppress [TikTok] and [Apify] log lines in non-TTY mode

Only print debug log lines when running in an interactive terminal.
In Claude Code (non-TTY), the spinner system handles progress display,
so these raw log lines just add noise.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-03-03 06:45:00 -08:00
parent 7c5763d048
commit d7b354b2cf
2 changed files with 8 additions and 10 deletions
+4 -3
View File
@@ -128,9 +128,10 @@ def _extract_core_subject(topic: str) -> str:
def _log(msg: str):
"""Log to stderr."""
sys.stderr.write(f"[TikTok] {msg}\n")
sys.stderr.flush()
"""Log to stderr (only in interactive terminals; spinner handles non-TTY)."""
if sys.stderr.isatty():
sys.stderr.write(f"[TikTok] {msg}\n")
sys.stderr.flush()
def _parse_date(item: Dict[str, Any]) -> Optional[str]: