lib/fbe/octo.rb in fbe-0.0.68 vs lib/fbe/octo.rb in fbe-0.0.69
- old
+ new
@@ -30,10 +30,11 @@
require 'faraday/http_cache'
require 'faraday/retry'
require_relative '../fbe'
require_relative 'middleware'
require_relative 'middleware/quota'
+require_relative 'middleware/logging_formatter'
# Interface to GitHub API.
#
# It is supposed to be used instead of Octokit client, because it
# is pre-configured and enables additional fearues, such as retrying,
@@ -89,10 +90,20 @@
backoff_factor: 2
)
builder.use(Fbe::Middleware::Quota, loog:, pause: options.github_api_pause || 60)
builder.use(Faraday::HttpCache, serializer: Marshal, shared_cache: false, logger: Loog::NULL)
builder.use(Octokit::Response::RaiseError)
- builder.use(Faraday::Response::Logger, Loog::NULL)
+ builder.use(
+ Faraday::Response::Logger,
+ loog,
+ {
+ formatter: Fbe::Middleware::LoggingFormatter,
+ log_only_errors: true,
+ headers: true,
+ bodies: true,
+ errors: false
+ }
+ )
builder.adapter(Faraday.default_adapter)
end
o.middleware = stack
o = Verbose.new(o, log: loog)
else