Skip to content

Mailgun::Client custom logger #343

@n-rodriguez

Description

@n-rodriguez

Hi there!

It would be nice to pass a custom logger to Mailgun::Client / Faraday for debugging like in Faraday documentation :

conn = Faraday.new(url: 'http://httpbingo.org') do |faraday|
  faraday.response :logger, MyLogger.new($stdout)
end

@http_client = Faraday.new(request_options) do |conn|
conn.request :multipart
conn.request :authorization, :basic, 'api', api_key
conn.request :url_encoded
conn.response :raise_error, include_request: true
conn.adapter Faraday.default_adapter
conn.options.params_encoder = Faraday::FlatParamsEncoder
end

See: https://lostisland.github.io/faraday/#/middleware/included/logging?id=customize-the-logger

Unfortunately Mailgun::Client constructor is not easy to use with positional arguments. It would be easier with keyword arguments.

So I would suggest to deprecate positional arguments and switch to keyword arguments first.

Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions