Skip to content

Add http_debug_logger option#155

Merged
yuokada merged 2 commits into
treasure-data:masterfrom
murakami-ta:add-http-debug-logger-option
May 27, 2026
Merged

Add http_debug_logger option#155
yuokada merged 2 commits into
treasure-data:masterfrom
murakami-ta:add-http-debug-logger-option

Conversation

@murakami-ta
Copy link
Copy Markdown
Contributor

@murakami-ta murakami-ta commented May 22, 2026

Purpose

Enable masking sensitive information (e.g. Authentication headers) in HTTP debug logs by allowing users to inject a custom logger.

Faraday's :logger middleware 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

  • Add http_debug_logger option to faraday_client that is passed to Faraday's :logger middleware
  • Add tests for custom logger, default logger, and no-logger behavior

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

@murakami-ta murakami-ta requested a review from a team as a code owner May 22, 2026 02:29
@yuokada yuokada requested a review from Copilot May 22, 2026 05:35
@yuokada yuokada self-assigned this May 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :logger response middleware when http_debug: true.
  • Add RSpec coverage for custom logger, default (STDOUT) logger, and disabled-logging behavior.
  • Document the new http_debug_logger option 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.

@yuokada
Copy link
Copy Markdown
Collaborator

yuokada commented May 25, 2026

@murakami-ta Thanks for your contribution. Could you fix the test failures?

Use a custom formatter instead of `progname` to verify the custom logger.
@murakami-ta
Copy link
Copy Markdown
Contributor Author

@yuokada Thanks for the review! I fixed the test failures. 0976be7

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Collaborator

@yuokada yuokada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuokada yuokada merged commit 143a801 into treasure-data:master May 27, 2026
9 checks passed
@yuokada
Copy link
Copy Markdown
Collaborator

yuokada commented May 27, 2026

@murakami-ta I've merged. We've released a new version below:
https://rubygems.org/gems/trino-client/versions/2.2.5

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants