lorekeeper 2.6.2 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6870cd9dbaba0f1a82e90805f8177a689cb8f1d8e3ff194ae403c8e68f85cfb
4
- data.tar.gz: 3f98d3e87de6f7a0c06fb3ba29405984f9aa74b105971f6bfcfb4786b2b6255f
3
+ metadata.gz: e282bfe416e749c799f15f0536b549564a754c772046e31ac718eb765c9883df
4
+ data.tar.gz: 002bee464879dc13c440b5fa835e844352f4f19bbf137926328e1f410e635dc8
5
5
  SHA512:
6
- metadata.gz: dabdb1a460cc3eddb6c1ae00cb99c3cb9ac044a62b5bb2b9f12ebc149d23978e513ee30e8b43bb5922b2976f90e7e942407a5a2b54635704c98c9dbcd586741d
7
- data.tar.gz: ec89d09e5daee804a3745a3c858b1305da2ba08d543b5d3766abfe66ba86d3c2e55d77a56e61d7f0273b82592627263f71aacada6265b18bc66f6fef7efb070c
6
+ metadata.gz: babd0aa08447fc53c1430c588439bb5743dbee7e0dbdfb8fc4d2f70e1a9fa231cf46e74e05e1b905515239f06573a33e59ecfacc7c8138c152de24bc234647b2
7
+ data.tar.gz: 2951023ec3da1084c90b0c2ac156ba98617c9b28cdded020dc179cd63c9345215b22fdfe732dbcc16c9d4e7c8d7e4eff39fe2089ebff6c756c6e9dc0120683ec
@@ -14,14 +14,32 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
  strategy:
16
16
  matrix:
17
- ruby-version: ['2.7', '3.0', '3.1', '3.2']
17
+ ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
18
+ rails: ['5.2.8', '6.0.6', '6.1.7', '7.0.8', '7.1.4', '7.2.1']
19
+ include:
20
+ - rails: '4.0.13'
21
+ ruby: '2.7'
22
+ - rails: '4.1.16'
23
+ ruby: '2.7'
24
+ - rails: '4.2.11'
25
+ ruby: '2.7'
26
+ - rails: '5.0.7'
27
+ ruby: '2.7'
28
+ - rails: '5.1.7'
29
+ ruby: '2.7'
30
+ exclude:
31
+ - rails: '7.2.1'
32
+ ruby: '2.7'
33
+ - rails: '7.2.1'
34
+ ruby: '3.0'
18
35
 
19
36
  steps:
20
- - uses: actions/checkout@v2
37
+ - uses: actions/checkout@v4
21
38
  - name: Set up Ruby
22
39
  uses: ruby/setup-ruby@v1
23
40
  with:
24
- ruby-version: ${{ matrix.ruby-version }}
41
+ ruby-version: ${{ matrix.ruby }}
42
+ cache-version: rails-${{ matrix.rails }} # for the cache key
25
43
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
26
44
  - name: Run rubocop
27
45
  run: bundle exec rubocop
@@ -29,3 +47,6 @@ jobs:
29
47
  run: bundle exec rspec
30
48
  - name: Run benchmark
31
49
  run: bundle exec rake benchmark
50
+
51
+ env:
52
+ RAILS_VER: ${{ matrix.rails }}
data/.rubocop.yml CHANGED
@@ -1,3 +1,5 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  require:
2
4
  - rubocop-performance
3
5
 
@@ -12,16 +14,20 @@ AllCops:
12
14
  #
13
15
  - 'vendor/bundle/**/*'
14
16
 
15
- Lint/ConstantDefinitionInBlock:
16
- Exclude:
17
- - 'spec/**/*'
18
-
19
17
  Layout/ArgumentAlignment:
20
18
  EnforcedStyle: with_fixed_indentation
21
19
 
22
20
  Layout/FirstHashElementIndentation:
23
21
  EnforcedStyle: consistent
24
22
 
23
+ Lint/ConstantDefinitionInBlock:
24
+ Exclude:
25
+ - 'spec/**/*'
26
+
27
+ Lint/StructNewOverride:
28
+ Exclude:
29
+ - spec/lib/lorekeeper/backtrace_cleaner_spec.rb
30
+
25
31
  Metrics/ParameterLists:
26
32
  CountKeywordArgs: false
27
33
 
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,28 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2023-10-30 07:24:07 UTC using RuboCop version 1.24.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: EnforcedStyle.
12
+ # SupportedStyles: space, no_space
13
+ Layout/SpaceAroundEqualsInParameterDefault:
14
+ Exclude:
15
+ - 'lib/lorekeeper/multi_logger.rb'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: AllowedMethods.
19
+ # AllowedMethods: respond_to_missing?
20
+ Style/OptionalBooleanParameter:
21
+ Exclude:
22
+ - 'lib/lorekeeper/multi_logger.rb'
23
+
24
+ # Offense count: 1
25
+ # Cop supports --auto-correct.
26
+ Style/RedundantFreeze:
27
+ Exclude:
28
+ - 'lib/lorekeeper/backtrace_cleaner.rb'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 2.6.4
2
+ * Reorder the exception fields to have the `data` field before the `exception` field
3
+
4
+ # 2.6.3
5
+ * Fix Lorekeeper::BacktraceCleaner to support BacktraceLocation
6
+
1
7
  # 2.6.2
2
8
  * Fix respond_to? method signature
3
9
 
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in lorekeeper.gemspec
6
6
  gemspec
7
+
8
+ gem 'activesupport', "~> #{ENV.fetch('RAILS_VER', '7.1.1')}"
@@ -38,6 +38,7 @@ module Lorekeeper
38
38
  last_index = nil
39
39
  result = []
40
40
  backtrace.each_with_index do |line, idx|
41
+ line = line.to_s
41
42
  if line.start_with?(@rails_root) && @gem_path.none? { |path| line.start_with?(path) }
42
43
  result << line[@rails_root_size..]
43
44
  last_index = idx
@@ -10,7 +10,7 @@ module Lorekeeper
10
10
  reset_state
11
11
  @base_fields = { TIMESTAMP => '', MESSAGE => '', LEVEL => '' }
12
12
 
13
- super(file)
13
+ super
14
14
  end
15
15
 
16
16
  def current_fields
@@ -28,10 +28,10 @@ module Lorekeeper
28
28
  # Delegates methods to the existing Logger instance
29
29
  # We are extending the logger API with methods error_with_data, etc
30
30
  LOGGING_METHODS.each do |method_name|
31
- define_method "#{method_name}_with_data", ->(message_param = nil, data = {}, &block) {
31
+ define_method :"#{method_name}_with_data", ->(message_param = nil, data = {}, &block) {
32
32
  return true if METHOD_SEVERITY_MAP[method_name] < @level
33
33
 
34
- extra_fields = { DATA => (data || {}) }
34
+ extra_fields = { DATA => data || {} }
35
35
  with_extra_fields(extra_fields) do
36
36
  add(METHOD_SEVERITY_MAP[method_name], message_param, nil, &block)
37
37
  end
@@ -77,17 +77,18 @@ module Lorekeeper
77
77
  if exception.is_a?(Exception)
78
78
  backtrace = clean_backtrace(exception.backtrace || [])
79
79
  exception_fields = {
80
+ DATA => param_data,
80
81
  EXCEPTION => "#{exception.class}: #{exception.message}",
81
82
  STACK => backtrace
82
83
  }
83
- exception_fields[DATA] = param_data if param_data
84
+ exception_fields.compact!
84
85
 
85
86
  message = param_message || exception.message
86
87
  with_extra_fields(exception_fields) { log_data(log_level, message) }
87
88
  else
88
89
  log_data(METHOD_SEVERITY_MAP[:warn], 'Logger exception called without exception class.')
89
90
  message = "#{exception.class}: #{exception.inspect} #{param_message}"
90
- with_extra_fields(DATA => (param_data || {})) { log_data(log_level, message) }
91
+ with_extra_fields(DATA => param_data || {}) { log_data(log_level, message) }
91
92
  end
92
93
  end
93
94
 
@@ -38,7 +38,7 @@ module Lorekeeper
38
38
 
39
39
  # Extending the logger API with methods error_with_data, etc
40
40
  LOGGING_METHODS.each do |method_name|
41
- define_method "#{method_name}_with_data", ->(message_param = nil, data = {}) {
41
+ define_method :"#{method_name}_with_data", ->(message_param = nil, data = {}) {
42
42
  return true if METHOD_SEVERITY_MAP[method_name] < @level
43
43
 
44
44
  log_data(METHOD_SEVERITY_MAP[method_name], "#{message_param}, data: #{data}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lorekeeper
4
- VERSION = '2.6.2'
4
+ VERSION = '2.6.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lorekeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-13 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -215,6 +215,7 @@ files:
215
215
  - ".gitignore"
216
216
  - ".rspec"
217
217
  - ".rubocop.yml"
218
+ - ".rubocop_todo.yml"
218
219
  - CHANGELOG.md
219
220
  - Gemfile
220
221
  - LICENSE.txt
@@ -234,7 +235,7 @@ homepage: https://github.com/JordiPolo/lorekeeper
234
235
  licenses:
235
236
  - MIT
236
237
  metadata: {}
237
- post_install_message:
238
+ post_install_message:
238
239
  rdoc_options: []
239
240
  require_paths:
240
241
  - lib
@@ -249,8 +250,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
250
  - !ruby/object:Gem::Version
250
251
  version: '0'
251
252
  requirements: []
252
- rubygems_version: 3.0.3.1
253
- signing_key:
253
+ rubygems_version: 3.5.3
254
+ signing_key:
254
255
  specification_version: 4
255
256
  summary: Very fast JSON logger
256
257
  test_files: []