logster 2.7.0 → 2.7.1

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: 106a0763acb86a917c9a1b2f3a3e80cfc4e9ef789a1904e76499d62ff5f66298
4
- data.tar.gz: 74aef16f2994ddde18124e9a914decb094fa275813eb31d396190f4bbd4d4e35
3
+ metadata.gz: 5e2fb360e66b19d26e80b991ce21ffea457434700d7610c10e68e429f94dbf42
4
+ data.tar.gz: f26c5e4b6d19284fa2e3ed2de99b4abe73c4c1a4c64afdf151c537d3c8dfbd1a
5
5
  SHA512:
6
- metadata.gz: ecc9724cc453bbf7c909c7ab9f6857250afc246dd1bc535ad7d29bbb1df7917c8f64b7e64f5a78d686f7118386c4359791fde6d8ca9e945e5f8213e3d76d8466
7
- data.tar.gz: ae722de77352b4c355ae7f330d3af1697142394ea63f5a5a67dcfaeb1e6fe9594278e4a0deb2f647a0ba6a89f4297ed16592d421b1b98709991e95160a427f8a
6
+ metadata.gz: 27fb6774bbe4db2d727b760273fe14c005719e1dc8ff1338cce78fbcae9cdd624baf420302903c8cef0e7f073713e72e9002312fe143faa26e3090431152bd99
7
+ data.tar.gz: cf1474a67c00acc807a297b496ba47a1051d316a5b19ae2c551d30d5ba12a04602124ab58ffc5077b0a4931ab3779973e04cb6536dccfc0ee1de3f115ed621c0
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ - 2020-03-03: 2.7.1
4
+
5
+ - FIX: Stop env mutation to allow all chained loggers to have the same env (#110)
6
+
3
7
  - 2020-02-26: 2.7.0
4
8
 
5
9
  - FEATURE: Make log message max length configurable and bump the default to 2000 (#109)
@@ -156,7 +156,7 @@ module Logster
156
156
  msg = truncate_message(msg)
157
157
  message = Logster::Message.new(severity, progname, msg, opts[:timestamp], count: opts[:count])
158
158
 
159
- env = opts[:env] || {}
159
+ env = opts[:env]&.dup || {}
160
160
  backtrace = opts[:backtrace]
161
161
  if Hash === env && env[:backtrace]
162
162
  # Special - passing backtrace through env
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Logster
4
- VERSION = "2.7.0"
4
+ VERSION = "2.7.1"
5
5
  end
@@ -176,4 +176,16 @@ class TestBaseStore < Minitest::Test
176
176
  ensure
177
177
  Logster.config.maximum_message_length = orig
178
178
  end
179
+
180
+ def test_chained_loggers_shouldnt_mutate_env_passed_to_them
181
+ logger = Logster::Logger.new(@store)
182
+ other_store = Logster::TestStore.new
183
+ other_logger = Logster::Logger.new(other_store)
184
+ logger.chain(other_logger)
185
+ logger.add(Logger::WARN, "this is warning", '', { env: { backtrace: '11' } })
186
+ [@store, other_store].each do |store|
187
+ assert_equal('11', store.reported.first.backtrace)
188
+ refute_includes(store.reported.first.env.keys.map(&:to_sym), :backtrace)
189
+ end
190
+ end
179
191
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logster
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - UI for viewing logs in Rack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-26 00:00:00.000000000 Z
11
+ date: 2020-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler