Restructure as Codex plugin

This commit is contained in:
Claire Novotny
2026-04-23 20:14:23 -04:00
parent 1f7e85a03f
commit 72495c1c14
156 changed files with 218 additions and 140 deletions
+28
View File
@@ -0,0 +1,28 @@
"""Shared logging utilities for last30days skill."""
import os
import sys
DEBUG = os.environ.get("LAST30DAYS_DEBUG", "").lower() in ("1", "true", "yes")
def debug(msg: str) -> None:
"""Log debug message to stderr (only when LAST30DAYS_DEBUG is set)."""
if DEBUG:
sys.stderr.write(f"[DEBUG] {msg}\n")
sys.stderr.flush()
def source_log(prefix: str, msg: str, *, tty_only: bool = True) -> None:
"""Log a source module message to stderr.
Args:
prefix: Source label (e.g. "Reddit", "Bird").
msg: Message text.
tty_only: If True, only log when stderr is a TTY (avoids cluttering
non-interactive output like Claude Code).
"""
if tty_only and not sys.stderr.isatty():
return
sys.stderr.write(f"[{prefix}] {msg}\n")
sys.stderr.flush()