Add http_debug_logger option#155
Merged
yuokada merged 2 commits intoMay 27, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds an optional http_debug_logger parameter to the Faraday client builder so callers can supply their own Ruby Logger instance for Faraday’s HTTP debug logging (enabling custom filtering/masking behavior without exposing Faraday-specific logger options in the gem’s public API).
Changes:
- Pass an optional custom logger to Faraday’s
:loggerresponse middleware whenhttp_debug: true. - Add RSpec coverage for custom logger, default (STDOUT) logger, and disabled-logging behavior.
- Document the new
http_debug_loggeroption in the README.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lib/trino/client/faraday_client.rb |
Threads http_debug_logger through to Faraday’s :logger middleware when http_debug is enabled. |
spec/statement_client_spec.rb |
Adds tests verifying custom logger output, default STDOUT logging, and no logging when http_debug is false. |
README.md |
Documents the new http_debug_logger option and its dependency on http_debug: true. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
@murakami-ta Thanks for your contribution. Could you fix the test failures? |
Use a custom formatter instead of `progname` to verify the custom logger.
Contributor
Author
Collaborator
|
@murakami-ta I've merged. We've released a new version below: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Enable masking sensitive information (e.g. Authentication headers) in HTTP debug logs by allowing users to inject a custom logger.
Faraday's
:loggermiddleware also supports options (e.g. filter headers), but exposing them would tightly couple this gem's interface to Faraday's internals. As a first step, only custom logger injection is added.Overview
http_debug_loggeroption to faraday_client that is passed to Faraday's:loggermiddlewareChecklist