Skip to content

Commit

Permalink
Merge pull request #47 from epimorphics/spike/resolve-ruby-version-co…
Browse files Browse the repository at this point in the history
…nflicts

Resolve Ruby Version Conflict
  • Loading branch information
jonrandahl authored May 16, 2023
2 parents 4686969 + bd065d4 commit fc9fdbc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.6
ruby-version: 2.6
- name: Install dependencies (bundle)
run: bundle install
- name: Run tests
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog for the JSON Rails Logger gem

## 0.3.5.5 - 2023-05-10

- (Jon) Reverted the `gemspec` file to ensure the gem accepts higher ruby versions
and allows it to work with current app integrations; e.g. regulated products
- (Jon) Reverted the `unit_tests.yml` file to ensure the test accepts higher ruby
versions and allows it to work with current app integrations; e.g. regulated products

## 0.3.5.4 - 2023-03-24

- (Jon) Removed the rails specific properties from the JSON output as they are not
Expand Down
2 changes: 1 addition & 1 deletion json_rails_logger.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.email = '[email protected]'
spec.homepage = 'https://github.com/epimorphics/json-rails-logger'
spec.license = 'MIT'
spec.required_ruby_version = '= 2.6.6'
spec.required_ruby_version = '>= 2.6'

spec.metadata = {
'github_repo' => '[email protected]:epimorphics/json-rails-logger.git',
Expand Down
6 changes: 4 additions & 2 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

def call(severity, timestamp, progname, raw_msg)
def call(severity, timestamp, _progname, raw_msg)
sev = process_severity(severity)
timestp = process_timestamp(timestamp)
msg = process_message(raw_msg)
Expand Down Expand Up @@ -46,7 +46,7 @@ def process_message(raw_msg)
return get_message(msg) if get_message?(msg)
return user_agent_message(msg) if user_agent_message?(msg)

{ message: msg.strip }
{ message: msg.squish }
end

# rubocop:disable Metrics/AbcSize
Expand All @@ -55,6 +55,8 @@ def format_message(msg)

return msg.merge(new_msg) if string_message_field?(msg)

return new_msg.merge(msg) if !msg.is_a?(Enumerable)

split_msg = msg.partition { |k, _v| COMMON_KEYS.include?(k.to_s) }.map(&:to_h)

# If duration is a float, convert it to an integer as microseconds
Expand Down
3 changes: 1 addition & 2 deletions lib/json_rails_logger/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module JsonRailsLogger
MAJOR = 0
MINOR = 3
PATCH = 5
SUFFIX = 4
SUFFIX = 5
VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}#{SUFFIX && '.' + SUFFIX.to_s}"

end

0 comments on commit fc9fdbc

Please sign in to comment.