Skip to content

Commit

Permalink
Tidy up usage of Console logger. (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix authored Apr 3, 2024
1 parent d92266f commit cf9b1b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/protocol/rack/adapter/generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def initialize(app)
end

def logger
Console.logger
Console
end

# Unwrap raw HTTP headers into the CGI-style expected by Rack middleware.
#
# Rack separates multiple headers with the same key, into a single field with multiple lines.
Expand Down Expand Up @@ -121,7 +121,7 @@ def call(request)

return Response.wrap(env, status, headers, meta, body, request)
rescue => exception
Console.logger.error(self) {exception}
Console.error(self, exception)

body&.close if body.respond_to?(:close)

Expand Down
2 changes: 1 addition & 1 deletion lib/protocol/rack/adapter/rack2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def call(request)

return Response.wrap(env, status, headers, meta, body, request)
rescue => exception
Console.logger.error(self) {exception}
Console.error(self, exception)

body&.close if body.respond_to?(:close)

Expand Down
2 changes: 1 addition & 1 deletion lib/protocol/rack/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.wrap(env, status, headers, meta, body, request = nil)
ignored = headers.extract(HOP_HEADERS)

unless ignored.empty?
Console.logger.warn(self, "Ignoring protocol-level headers: #{ignored.inspect}")
Console.warn(self, "Ignoring hop headers!", ignored: ignored)
end

if hijack_body = meta['rack.hijack']
Expand Down

0 comments on commit cf9b1b0

Please sign in to comment.