Skip to content

Refactor logging suppression with policy overrides and feature-gated video filter#423

Open
AJaySi wants to merge 1 commit intomainfrom
codex/refactor-logging-suppression-logic
Open

Refactor logging suppression with policy overrides and feature-gated video filter#423
AJaySi wants to merge 1 commit intomainfrom
codex/refactor-logging-suppression-logic

Conversation

@AJaySi
Copy link
Owner

@AJaySi AJaySi commented Mar 12, 2026

Motivation

  • Consolidate scattered logger suppression into a declarative, maintainable policy set to make suppression behavior easier to reason about and extend.
  • Allow runtime overrides of logger levels via an environment variable so operators can relax or tighten specific loggers without changing code by using ALWRITY_LOG_LEVEL_OVERRIDES.
  • Keep the Story Video focused INFO sink but make it opt-in behind a clear feature flag to avoid surprising console output by default via ALWRITY_ENABLE_STORY_VIDEO_LOG_FILTER.

Description

  • Documented the override format in the module docstring and added support for comma-separated module=LEVEL overrides via ALWRITY_LOG_LEVEL_OVERRIDES.
  • Introduced DEFAULT_NAMESPACE_LEVEL_POLICIES and a NOISY_LOGGERS list and consolidated suppression into _build_logger_level_policies() and _apply_logger_level_policies() to apply levels programmatically.
  • Added parsing and deduplication logic in _parse_log_level_overrides() where the last duplicate wins and invalid entries are ignored, and unified boolean env parsing in _is_enabled() which is used in setup_clean_logging() and get_uvicorn_log_level().
  • Moved the Story Video generation sink behind the feature flag ALWRITY_ENABLE_STORY_VIDEO_LOG_FILTER so it is only registered when explicitly enabled.

Testing

  • Ran python -m py_compile backend/logging_config.py to verify the module compiles successfully (passed).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant