-
Notifications
You must be signed in to change notification settings - Fork 258
Use fixed logging level on 3rd party loggers to avoid spamming our logs #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe constructor of the Changes
Sequence Diagram(s)sequenceDiagram
participant SupabaseDal
participant Logger
SupabaseDal->>Logger: Retrieve "httpx" logger
SupabaseDal->>Logger: Set level to WARNING and log info message
SupabaseDal->>Logger: Retrieve "httpcore" logger
SupabaseDal->>Logger: Set level to WARNING and log info message
SupabaseDal->>Logger: Retrieve "hpack" logger
SupabaseDal->>Logger: Set level to WARNING and log info message
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
enforcer/dal/supabase_dal.py (2)
40-40: Remove redundant conditional check.The
if http_logger:check is redundant becauselogging.getLogger()always returns a logger object, neverNone.- if http_logger: - logging.info(f"Setting logging level for {http_logger_name} to WARNING") - http_logger.setLevel(logging.WARNING) + logging.info(f"Setting logging level for {http_logger_name} to WARNING") + http_logger.setLevel(logging.WARNING)
41-41: Use lazy formatting in logging functions.As flagged by pylint, use lazy % formatting in logging functions for better performance.
- logging.info(f"Setting logging level for {http_logger_name} to WARNING") + logging.info("Setting logging level for %s to WARNING", http_logger_name)🧰 Tools
🪛 Pylint (3.3.7)
[warning] 41-41: Use lazy % formatting in logging functions
(W1203)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
enforcer/dal/supabase_dal.py(1 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
enforcer/dal/supabase_dal.py
[warning] 41-41: Use lazy % formatting in logging functions
(W1203)
🔇 Additional comments (1)
enforcer/dal/supabase_dal.py (1)
38-42: Good approach to suppress noisy HTTP library logs.The implementation correctly expands logging suppression to multiple HTTP-related libraries, which should effectively reduce log spam. However, there are a couple of minor issues to address.
🧰 Tools
🪛 Pylint (3.3.7)
[warning] 41-41: Use lazy % formatting in logging functions
(W1203)
Summary by CodeRabbit