Skip to content

feat: central logging via rich + stdlib (TASK 030) - #38

Merged
nceglia merged 1 commit into
mainfrom
feat/task-030-logging-foundation
May 8, 2026
Merged

feat: central logging via rich + stdlib (TASK 030)#38
nceglia merged 1 commit into
mainfrom
feat/task-030-logging-foundation

Conversation

@nceglia

@nceglia nceglia commented May 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds genevector/_logging.py with get_logger(name) and a shared rich Console.
  • Replaces all bcolors + print() usage in data.py, model.py, and embedding.py with module-level loggers.
  • Default level is INFO; override via GENEVECTOR_LOG_LEVEL env var (e.g. WARNING, ERROR).
  • RichHandler on TTY, plain StreamHandler otherwise (CI logs, redirects, sandboxes).
  • Foundation for TASKs 031-035 (panels, progress bars, verbose API, run summaries, unified progress).

Mapping

Old New
bcolors.OK* / HEADER / BOLD + print() logger.info()
bcolors.WARNING + print() logger.warning()
bcolors.FAIL + print() logger.error()
Plain print() logger.info()

Decorative asterisk separators around "Loading Dataset." dropped — TASK 031 will reintroduce structured headers via rich.panel.Panel.

Dependency

Adds rich>=13.0 to pyproject.toml and requirements.txt. CI installs the wheel, which pulls runtime deps from pyproject — no workflow change needed.

Test plan

  • pytest tests/test_logging.py -v (5 new tests: returns logger, env-var level, default INFO, handler idempotence, no propagation)
  • Full local suite: 78 passed, 2 xfailed (pre-existing)
  • Smoke (default INFO): produces INFO: Loading Expression. style lines, no ANSI escapes
  • Smoke (GENEVECTOR_LOG_LEVEL=WARNING): cleanly suppresses INFO output
  • CI green across Python 3.9 / 3.10 / 3.11 / 3.12

🤖 Generated with Claude Code

Adds genevector/_logging.py with get_logger() and a shared rich
Console. Replaces all bcolors + print() usage in data.py, model.py,
and embedding.py with module-level loggers.

Default level is INFO; override via GENEVECTOR_LOG_LEVEL env var.
RichHandler used on TTY, plain StreamHandler otherwise. Decorative
asterisk separators dropped — TASK 031 will reintroduce headers via
rich.panel.Panel.

Foundation for TASKs 031-035 (panels, progress bars, verbose API,
run summaries, unified progress).

Adds rich>=13.0 as runtime dep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nceglia
nceglia merged commit 5c82296 into main May 8, 2026
4 checks passed
@nceglia
nceglia deleted the feat/task-030-logging-foundation branch May 8, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant