Skip to content

Commit

Permalink
fix: removed commas from request method list
Browse files Browse the repository at this point in the history
`%w[]` is a non-interpolated array of words, separated by whitespace therefore doesn't need comma separation
  • Loading branch information
jonrandahl committed Jun 2, 2023
1 parent 152f26b commit 8fbabde
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/json_rails_logger/json_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class JsonFormatter < ::Logger::Formatter
method path status duration user_agent accept request_id
].freeze

REQUEST_METHODS = %w[GET, POST, PUT, DELETE, PATCH].freeze
REQUEST_METHODS = %w[GET POST PUT DELETE PATCH].freeze

def call(severity, timestamp, _progname, raw_msg)
sev = process_severity(severity)
Expand Down Expand Up @@ -45,7 +45,6 @@ def process_message(raw_msg)
msg = normalize_message(raw_msg)

return msg unless msg.is_a?(String)

return status_message(msg) if status_message?(msg)
return request_type(msg) if request_type?(msg)
return user_agent_message(msg) if user_agent_message?(msg)
Expand Down Expand Up @@ -106,7 +105,6 @@ def request_type(msg)
splitted_msg = msg.split
method = splitted_msg[0]
path = splitted_msg[1]

{ method: method, path: path }
end

Expand Down

0 comments on commit 8fbabde

Please sign in to comment.