Skip to content

Commit

Permalink
Reorder fields to have the data field before the exception field
Browse files Browse the repository at this point in the history
  • Loading branch information
ykitamura-mdsol committed Sep 19, 2024
1 parent fbd22ea commit 3056f07
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
rails: ['5.2.7', '6.0.4', '6.1.7', '7.0.8', '7.1.1']
rails: ['5.2.8', '6.0.6', '6.1.7', '7.0.8', '7.1.4', '7.2.1']
include:
- rails: '4.0.1'
- rails: '4.0.13'
ruby: '2.7'
- rails: '4.1.1'
- rails: '4.1.16'
ruby: '2.7'
- rails: '4.2.1'
- rails: '4.2.11'
ruby: '2.7'
- rails: '5.0.1'
- rails: '5.0.7'
ruby: '2.7'
- rails: '5.1.1'
- rails: '5.1.7'
ruby: '2.7'

steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.6.4
* Reorder fields to have the `data` field before the `exception` field

# 2.6.3
* Fix Lorekeeper::BacktraceCleaner to support BacktraceLocation

Expand Down
3 changes: 2 additions & 1 deletion lib/lorekeeper/json_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ def exception(exception, custom_message = nil, custom_data = nil, custom_level =
if exception.is_a?(Exception)
backtrace = clean_backtrace(exception.backtrace || [])
exception_fields = {
DATA => param_data,
EXCEPTION => "#{exception.class}: #{exception.message}",
STACK => backtrace
}
exception_fields[DATA] = param_data if param_data
exception_fields.compact!

message = param_message || exception.message
with_extra_fields(exception_fields) { log_data(log_level, message) }
Expand Down
2 changes: 1 addition & 1 deletion lib/lorekeeper/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Lorekeeper
VERSION = '2.6.3'
VERSION = '2.6.4'
end

0 comments on commit 3056f07

Please sign in to comment.