Skip to content

Commit 3cff133

Browse files
committed
Rails.logger is ActiveSupport::BroadcastLogger
1 parent ed4e496 commit 3cff133

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lib/vigiles/archive/response.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class InextricableResponseBodyError < StandardError
1515
attr_reader :response_body_class
1616

1717
sig { params(response_body_class: String).void }
18-
def initialize(response_body_class:)
18+
def initialize(response_body_class)
1919
@response_body_class = response_body_class
2020
super("failed to extract response body: response_body_class=#{response_body_class}")
2121
end
@@ -44,7 +44,7 @@ def initialize(stack_depth, max_stack_depth)
4444
case (inner_body = body.instance_variable_get(:@body))
4545
when Rack::BodyProxy then extract_body_from_rack_body_proxy(inner_body, stack_depth + 1)
4646
when Array then inner_body[0] || "null"
47-
else raise InextricableResponseBodyError.new(inner_body.class.name)
47+
else raise InextricableResponseBodyError, inner_body.class.name
4848
end
4949
end
5050

@@ -73,7 +73,7 @@ def self.from(res)
7373
rack_response: res,
7474
content_type: res.headers["Content-Type"] || "unknown_content_type",
7575
headers: res.headers.as_json,
76-
payload: extract_payload(res) || {__false_body: :body_may_be_nil},
76+
payload: extract_payload(res) || { __false_body: :body_may_be_nil },
7777
status: res.status
7878
)
7979
end

lib/vigiles/middleware/record_conversation.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def call(env)
4141
logger.warn \
4242
"[vigiles] conversation recorder error: " \
4343
"error_message=#{e.message} " \
44-
"error_class=#{e.class}"
44+
"error_class=#{e.class} " \
45+
"backtrace=#{e.backtrace}"
4546
ensure
4647
# no matter what happens we shouldn't prevent the rack
4748
# response from being returned. at this point, the only

lib/vigiles/options.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module Vigiles
88
class Options < T::Struct
99
const :capture_exception, T.proc.params(a0: StandardError).void
10-
const :logger, ::Logger
10+
const :logger, T.any(::Logger, ActiveSupport::BroadcastLogger)
1111

1212
sig { returns(Options) }
1313
def self.make_default_options

0 commit comments

Comments
 (0)