1.5 KiB
git diff a966928dead4cbf369ad244834ce9dbe988ac8ca wkt/address_logging_levels -- tractor/log.py
Extend at_least_level() to resolve uppercase names first through CUSTOM_LEVELS, then through logging.getLevelNamesMapping(). Preserve integer inputs, zero-valued NOTSET, KeyError for unknown names, and Logger.isEnabledFor() disable semantics. Update the adapter’s annotation to advertise its existing integer support.
git diff a966928dead4cbf369ad244834ce9dbe988ac8ca wkt/address_logging_levels -- tests/test_log_sys.py
Add an isolated raw/adapted logger fixture and regressions for standard names and aliases, lowercase names, custom CANCEL, integer and NOTSET inputs, application-registered names, unknown names, and logger-local/global disable controls.
Tractor’s logging suite passes: 70 tests. Before the source fix, the new regressions produced 30 failures, including INFO, NOTSET, and application-registered names. Ruff and whitespace checks also pass.
The original Piker consumer probe now passes 8/8, including the cache-hit case with log.at_least_level('info') retained. Import assertions confirm it used the new Tractor worktree. The probe needed a process-local overlay of existing Nix libraries to import Piker.