feat: central logging via rich + stdlib (TASK 030) - #38
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
genevector/_logging.pywithget_logger(name)and a shared richConsole.bcolors+print()usage indata.py,model.py, andembedding.pywith module-level loggers.INFO; override viaGENEVECTOR_LOG_LEVELenv var (e.g.WARNING,ERROR).RichHandleron TTY, plainStreamHandlerotherwise (CI logs, redirects, sandboxes).Mapping
bcolors.OK*/HEADER/BOLD+print()logger.info()bcolors.WARNING+print()logger.warning()bcolors.FAIL+print()logger.error()print()logger.info()Decorative asterisk separators around "Loading Dataset." dropped — TASK 031 will reintroduce structured headers via
rich.panel.Panel.Dependency
Adds
rich>=13.0topyproject.tomlandrequirements.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)INFO: Loading Expression.style lines, no ANSI escapesGENEVECTOR_LOG_LEVEL=WARNING): cleanly suppresses INFO output🤖 Generated with Claude Code