lorekeeper 2.6.2 → 2.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +24 -3
- data/.rubocop.yml +10 -4
- data/.rubocop_todo.yml +28 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +2 -0
- data/lib/lorekeeper/backtrace_cleaner.rb +1 -0
- data/lib/lorekeeper/json_logger.rb +6 -5
- data/lib/lorekeeper/simple_logger.rb +1 -1
- data/lib/lorekeeper/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e282bfe416e749c799f15f0536b549564a754c772046e31ac718eb765c9883df
|
4
|
+
data.tar.gz: 002bee464879dc13c440b5fa835e844352f4f19bbf137926328e1f410e635dc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: babd0aa08447fc53c1430c588439bb5743dbee7e0dbdfb8fc4d2f70e1a9fa231cf46e74e05e1b905515239f06573a33e59ecfacc7c8138c152de24bc234647b2
|
7
|
+
data.tar.gz: 2951023ec3da1084c90b0c2ac156ba98617c9b28cdded020dc179cd63c9345215b22fdfe732dbcc16c9d4e7c8d7e4eff39fe2089ebff6c756c6e9dc0120683ec
|
data/.github/workflows/build.yml
CHANGED
@@ -14,14 +14,32 @@ jobs:
|
|
14
14
|
runs-on: ubuntu-latest
|
15
15
|
strategy:
|
16
16
|
matrix:
|
17
|
-
ruby
|
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@
|
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
|
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
data/Gemfile
CHANGED
@@ -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
|
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 =>
|
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
|
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 =>
|
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}")
|
data/lib/lorekeeper/version.rb
CHANGED
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.
|
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:
|
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.
|
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: []
|