Skip to content

feat: add logging_enabled flag, decouple from service_debug#85

Merged
lesnik512 merged 1 commit intomainfrom
fix/logging-enabled-flag
May 2, 2026
Merged

feat: add logging_enabled flag, decouple from service_debug#85
lesnik512 merged 1 commit intomainfrom
fix/logging-enabled-flag

Conversation

@lesnik512
Copy link
Copy Markdown
Member

LoggingInstrument.is_ready() previously returned False whenever service_debug=True — and BaseConfig.service_debug defaults to True. So out of the box, the structured-logging instrument silently skipped its own bootstrap, and users assumed the JSON logging pipeline was working when it wasn't.

Add a dedicated logging_enabled: bool = True field on LoggingConfig and gate is_ready() on it instead. service_debug stays focused on framework debug mode (FastAPI/Litestar app.debug). Default behavior changes: projects with no overrides now get structured logging. Users who want the old skip-logging behavior set logging_enabled=False explicitly.

LoggingInstrument.is_ready() previously returned False whenever
service_debug=True — and BaseConfig.service_debug defaults to True. So
out of the box, the structured-logging instrument silently skipped its
own bootstrap, and users assumed the JSON logging pipeline was working
when it wasn't.

Add a dedicated logging_enabled: bool = True field on LoggingConfig and
gate is_ready() on it instead. service_debug stays focused on framework
debug mode (FastAPI/Litestar app.debug). Default behavior changes:
projects with no overrides now get structured logging. Users who want
the old skip-logging behavior set logging_enabled=False explicitly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lesnik512 lesnik512 self-assigned this May 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lite_bootstrap/instruments/logging_instrument.py 100.00% <100.00%> (ø)
tests/test_free_bootstrap.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lesnik512 lesnik512 merged commit 735f2ed into main May 2, 2026
13 of 14 checks passed
@lesnik512 lesnik512 deleted the fix/logging-enabled-flag branch May 2, 2026 16:15
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