lorekeeper 1.11.1 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfcc3f33a2a846246a7e85d8c8c2730d1099bb0c41b80b86998ffd6beb5736a4
4
- data.tar.gz: 2e7b7f4a5e80c372ca5b17b4f961efa80bbd17e67713a075064c63659767bc2f
3
+ metadata.gz: db3ae6a493b8fc903122557d5144db57633e3c72a881cb4bc88ad458d438f7dc
4
+ data.tar.gz: 69ba8f5fd5ea48d6325f27ae777c91e857e28c5f7e6093cef71aa427cfcb8266
5
5
  SHA512:
6
- metadata.gz: fc4fa20700854b22f850129142a801ac56131e0f46e6f7ad74e69356821505715514c3b32041c58eaf3affa4dfe0ec951244e5e63222c26a08b115d9ecf8ea3f
7
- data.tar.gz: 8de40794309ff297adee1865243dbc856a6b6f687cef620af6807b5a582e2011b00ab822a948e870368b01bcce9ac0c3071eba9d7b95ce8a75c8451468cc4dfa
6
+ metadata.gz: 5b3b703f5182598b73f0c86411b9a627060eed1e0c59ddd1b9507dd3e9f28b5c3239e2e48a59bdf42edc017fa5df1acb4ba8aee5f502f73f21ff6fcc1876c8b4
7
+ data.tar.gz: 8925f11071fbccff8ddca89066a473b9286c8aedd87f9b76c3f872388e83ead883f2b78fe3645e71753009535f9e7b2e09e0e3921b4f64883a86f49c3737da72
@@ -0,0 +1,29 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: build
9
+
10
+ on: [push, pull_request]
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ ruby-version: ['2.5', '2.6', '2.7', '3.0']
18
+
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby-version }}
25
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
26
+ - name: Run tests
27
+ run: bundle exec rspec
28
+ - name: Run benchmark
29
+ run: bundle exec rake benchmark
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.12.0
2
+ * Remove ZipkinTracer information from stacktrace output
3
+ * Move CI to GitHub Actions
4
+
1
5
  # 1.11.1
2
6
  * Modify FastLogger#add to log progname as a message if no message and block are given
3
7
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lorekeeper
2
2
 
3
- [![Build Status](https://travis-ci.org/JordiPolo/lorekeeper.svg?branch=master)](https://travis-ci.org/JordiPolo/lorekeeper)
3
+ [![build](https://github.com/JordiPolo/lorekeeper/actions/workflows/build.yml/badge.svg)](https://github.com/JordiPolo/lorekeeper/actions/workflows/build.yml)
4
4
 
5
5
  LoreKeeper contains a highly optimized JSON logger. It outputs messages as JSON and let the users to add their own customized fields.
6
6
  When used without extra fields it outputs 20% faster than the standard Logger for messages not longer than one line of text.
@@ -141,7 +141,7 @@ Will output:
141
141
  }
142
142
  ```
143
143
 
144
- This method also accepts a custom message, data and log level.
144
+ This method also accepts a custom message, data and log level:
145
145
 
146
146
  ```ruby
147
147
  rescue => e
@@ -169,16 +169,30 @@ Will output:
169
169
  }
170
170
  ```
171
171
 
172
- Alternatively you can use named parameters:
172
+ Please note that due to the way Ruby 2.x automatically converts Hash objects to keyword arguments when they come last,
173
+ you need to explicitly use the `data` keyword argument when you don't pass any other argument afterwards:
173
174
 
174
175
 
176
+ ```ruby
177
+ logger.exception(e, "custom msg!", { some: { data: 123 } })
178
+ # => ArgumentError: unknown keyword: some
179
+
180
+ logger.exception(e, "custom msg!", data: { some: { data: 123 } })
181
+ # => works
182
+ ```
183
+
184
+ Ruby 3.x is unaffected by this issue since the conversion is [not done automatically anymore](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/).
185
+
186
+
187
+ The available keyword arguments are `message`, `data` and `level`. They can be used instead of the fixed arguments:
188
+
175
189
  ```ruby
176
190
  rescue => e
177
191
  logger.exception(e, message: "custom msg!", data: { some: { data: 123 } }, level: :warn)
178
192
  end
179
193
  ```
180
194
 
181
- This is specially useful when there is no custom message or data:
195
+ This is especially useful when there is no custom message or data:
182
196
 
183
197
  ```ruby
184
198
  rescue => e
@@ -98,7 +98,7 @@ module Lorekeeper
98
98
 
99
99
  # Some instrumentation libraries pollute the stacktrace and create a large output which may
100
100
  # cause problems with certain logging backends.
101
- # Hardcording newrelic and active_support/callbacks now here.
101
+ # Hardcording newrelic, active_support/callbacks and zipkin-tracer now here.
102
102
  # In the future if this list grows, we may make it configurable.
103
103
  def clean_backtrace(backtrace)
104
104
  @backtrace_cleaner&.clean(backtrace) || backtrace
@@ -121,7 +121,7 @@ module Lorekeeper
121
121
  EXCEPTION = 'exception'
122
122
  STACK = 'stack'
123
123
  DATA = 'data'
124
- BLACKLISTED_FINGERPRINT = %r{newrelic_rpm|active_support/callbacks.rb}.freeze
124
+ BLACKLISTED_FINGERPRINT = %r{newrelic_rpm|active_support/callbacks.rb|zipkin-tracer}.freeze
125
125
 
126
126
  def with_extra_fields(fields)
127
127
  state[:extra_fields] = fields
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lorekeeper
4
- VERSION = '1.11.1'
4
+ VERSION = '1.12.0'
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: 1.11.1
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-29 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -183,10 +183,10 @@ executables: []
183
183
  extensions: []
184
184
  extra_rdoc_files: []
185
185
  files:
186
+ - ".github/workflows/build.yml"
186
187
  - ".gitignore"
187
188
  - ".rspec"
188
189
  - ".rubocop.yml"
189
- - ".travis.yml"
190
190
  - CHANGELOG.md
191
191
  - Gemfile
192
192
  - LICENSE.txt
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
-
4
- rvm:
5
- - 2.4.9
6
- - 2.5.8
7
- - 2.6.6
8
- - 2.7.2
9
- - 3.0.0
10
-
11
- script: bundle exec rspec