Skip to content

fix(logging): clamp verbosity levels outside 0-3 - #141

Open
xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/verbosity-out-of-range
Open

xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/verbosity-out-of-range

Conversation

@xillig

@xillig xillig commented Nov 11, 2026

Copy link
Copy Markdown

Problem

set_verbosity() mapped any level outside 0-3 to INFO, so verbosity was not monotonic: Preprocessor(verbose=4) printed only the fit summary and dropped the per-feature table and the fitted decisions that verbose=2 / 3 log, and set_verbosity(-1) was louder than 0.

Fix

The level is clamped into 0-3. This also covers configure_logging() and the Preprocessor verbose parameter, which both go through set_verbosity().

Tests and docs

Tests in tests/integration/test_verbosity.py (clamping, configure_logging, verbose=4 logs exactly what verbose=3 logs); docstrings and the fit-time logging section of outputs_and_inspection.md are updated.

Validation

Checks: full suite (2553 passed, 59 skipped, 7 xfailed, coverage >= 94.79%), ruff format / ruff check, pyright (no new diagnostics), docs build with -W, scripts/quickstart.py. Merges cleanly with main and with #136.

set_verbosity() mapped any level outside 0-3 to INFO. A level above 3
therefore logged less than 3, and a negative level more than 0:
Preprocessor(verbose=4) printed only the fit summary and dropped the
per-feature table and the fitted decisions that verbose=2 and 3 log.

The level is now clamped into 0-3, so verbosity never decreases as the
level grows. This also applies to configure_logging() and to the
Preprocessor's verbose parameter, which both go through set_verbosity().

This branch has not been deployed

No deployments
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