Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shared/logging/src/airflow_shared/logging/structlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ def is_atty():
# These ones are too chatty even at info
"httpx": {"level": "WARN"},
"sqlalchemy.engine": {"level": "WARN"},
"alembic.runtime.plugins": {"level": "WARN"},
}
)
config["root"] = {
Expand Down
13 changes: 13 additions & 0 deletions shared/logging/tests/logging/test_structlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,19 @@ def test_logger_respects_configured_level(structlog_config):
assert "[my_logger] Debug message\n" in written


def test_alembic_runtime_plugin_setup_logs_are_suppressed(structlog_config):
with structlog_config(
colors=False,
log_format="[%(name)s] %(message)s",
log_level="INFO",
) as sio:
logger = logging.getLogger("alembic.runtime.plugins")
logger.info("Filtered plugin setup message")
logger.warning("Visible warning")

assert sio.getvalue() == "[alembic.runtime.plugins] Visible warning\n"


def test_excepthook_installed_when_json_output_true(structlog_config):
import sys

Expand Down