Replies: 1 comment
-
hi @ddehghan what about something like this? @pytest.fixture(autouse=True)
def suppress_prefect_internal_logs():
"""Add this to conftest.py to suppress Prefect internal DEBUG logs."""
internal_logger = logging.getLogger("prefect._internal")
original_levels = []
for handler in internal_logger.handlers:
original_levels.append((handler, handler.level))
if handler.level == 0: # Debug handler
handler.setLevel(logging.CRITICAL)
yield
for handler, level in original_levels:
handler.setLevel(level) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm struggling to suppress Prefect's internal logs during tests and would really appreciate any help.
No matter what I try, I keep seeing logs like:
Setup:
What I’ve tried:
prefect_test_harness()
, but it doesn’t work well for me because my tasks involve SQL and rate limiting. SQLite was throwing table lock errors (due to concurrent reads/writes).PREFECT_LOGGING_LEVEL=CRITICAL
on my local machine — no effect.Environment:
From my dev machine:
Has anyone managed to fully suppress these internal DEBUG logs — especially from
prefect._internal.concurrency
— during tests? Any workaround or configuration trick that actually works?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions