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:
@@ -59,8 +59,6 @@ def run_actor_sync(
|
|||||||
Returns:
|
Returns:
|
||||||
List of result dicts from the actor's default dataset
|
List of result dicts from the actor's default dataset
|
||||||
"""
|
"""
|
||||||
_log(f"Running actor {actor_id} (timeout={timeout_secs}s)")
|
|
||||||
|
|
||||||
run = client.actor(actor_id).call(
|
run = client.actor(actor_id).call(
|
||||||
run_input=run_input,
|
run_input=run_input,
|
||||||
timeout_secs=timeout_secs,
|
timeout_secs=timeout_secs,
|
||||||
@@ -72,12 +70,11 @@ def run_actor_sync(
|
|||||||
|
|
||||||
if max_items and len(items) > max_items:
|
if max_items and len(items) > max_items:
|
||||||
items = items[:max_items]
|
items = items[:max_items]
|
||||||
|
|
||||||
_log(f"Actor {actor_id} returned {len(items)} items")
|
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
|
||||||
def _log(msg: str):
|
def _log(msg: str):
|
||||||
"""Log to stderr."""
|
"""Log to stderr (only in interactive terminals; spinner handles non-TTY)."""
|
||||||
sys.stderr.write(f"[Apify] {msg}\n")
|
if sys.stderr.isatty():
|
||||||
sys.stderr.flush()
|
sys.stderr.write(f"[Apify] {msg}\n")
|
||||||
|
sys.stderr.flush()
|
||||||
|
|||||||
@@ -128,9 +128,10 @@ def _extract_core_subject(topic: str) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def _log(msg: str):
|
def _log(msg: str):
|
||||||
"""Log to stderr."""
|
"""Log to stderr (only in interactive terminals; spinner handles non-TTY)."""
|
||||||
sys.stderr.write(f"[TikTok] {msg}\n")
|
if sys.stderr.isatty():
|
||||||
sys.stderr.flush()
|
sys.stderr.write(f"[TikTok] {msg}\n")
|
||||||
|
sys.stderr.flush()
|
||||||
|
|
||||||
|
|
||||||
def _parse_date(item: Dict[str, Any]) -> Optional[str]:
|
def _parse_date(item: Dict[str, Any]) -> Optional[str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user