"""The worker's own debug log. It writes to the process's original stderr, so it still shows while the brain's output is muted (``brain.Muted``); otherwise it is ``jarvis.debug.debug_log``.""" from __future__ import annotations import sys from jarvis import debug as _jarvis_debug def debug_log(message: str, category: str = "debug") -> None: if not _jarvis_debug._is_debug_enabled(): return try: print(f"[{category:^10}] {message}", file=sys.__stderr__, flush=True) except Exception: pass def notice(message: str, category: str = "debug") -> None: """A line the user needs also without debug logging (the app's log screen shows every worker line; a ``Warning`` in it marks it as a warning there).""" try: print(f"[{category:^10}] {message}", file=sys.__stderr__, flush=True) except Exception: pass