Repository navigation
fix: 🐛 stop configuring global logging; replace structlog with stdlib logging - #52
Merged
Merged
Conversation
… logging Importing src_method no longer calls logging.basicConfig() or structlog.configure(), so the root logger level and handlers of the host application are left untouched. The package now uses logging.getLogger(__name__) per module with a NullHandler on the top-level logger, emits progress messages at DEBUG with lazy %-style arguments, and drops the structlog runtime dependency and the LOG_LEVEL_SRC variable. Fixes #11 Assisted-by: pi:claude-opus-5.5
Contributor
Panadestein
added a commit
that referenced
this pull request
Oct 7, 2026
Resolve the conflicts with stdlib logging (#52), input-precision sketches (#36), validation (#38), ty enforcement (#37, #55) and the Fumadocs site (#56): - the sweep draws its sketches with gaussian_sketch and logs its plan, pass times and stalls at DEBUG with %-style arguments; - the working dtype is promoted over every site, not just the first; - docs/large-problems.md moves to features/large-problems.mdx and the out-of-core testing notes to contributing/testing.mdx; - bench_large.py logs through the stdlib and gains --debug. Type lazily read sites: the entry points accept any array-like with shape, dtype, ndim and np.asarray support but were typed Sequence[NDArray]. Add the SiteLike protocol and the Site alias, use them from src/apply/compress down to the site source, and export SiteLike. Also fix the other ty findings: the Tier list in the planner, known_kind() for validated trains, padded_shape without a type: ignore, cupyx as an allowed unresolved import, and typed fakes in the tests. Assisted-by: pi:claude-opus-5.5
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.
🤖 AI text below 🤖
Fixes #11.
What
Importing
src_methodused to calllogging.basicConfig()(root atINFO, a stdoutStreamHandler) and a globalstructlog.configure(). These now sit instack.py, sinceapply/compressdelegate tosrc. This PR switches to the usual library logging pattern:structlogis removed from[project.dependencies](anduv.lock).src_method/utils/logging_config.py,setup_logging()and theLOG_LEVEL_SRCenv var are removed.logger = logging.getLogger(__name__)with lazy%-style arguments.src_method/__init__.pyadds aNullHandlerto the package logger.INFOtoDEBUG. The sweep timings were alreadyDEBUG, and the expensive "largest environment" size is computed only whenDEBUGis on.WARNING. Thanks to theNullHandlerit no longer reaches stderr unless the application configures logging.Tests
New
tests/test_logging.py:apply/compressprint nothing to stdout or stderr by default, including on the fallback path.src_methodlogger atDEBUGwhen it is enabled.Docs and tooling
README.mdanddocs/index.mdhave a new Logging section on how to turn logging on.AGENTS.mdnow describes the stdlib logging rule.benches/stack/bench_depth.py,benches/primitives/leonardo/bench_mpo_mpo.py) use stdlib logging and configure it themselves in__main__.LOG_LEVEL_SRCis gone fromrun.shand the stack bench README.uv run prek run --all-filesis clean, anduv run pytest -m "not slow"gives 123 passed, 1 skipped (no CuPy).