lumberjack 2.0.3 → 2.0.5

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: 140e49b15017aa81ca85a2e42a9de896b09938b5f9dd437a8f2917f821831d3d
4
- data.tar.gz: fe95870efcfb98d6831833e4125a74817f93c718969febcdba81e0b3b6e149a1
3
+ metadata.gz: 8e1af0567acc694ebd29f04587e9203db03d14958306abd6a691721c918cd024
4
+ data.tar.gz: 0eab429fc4ef909b57cec680fc84ab5cb12fd99a0e986d105d497be9dee97369
5
5
  SHA512:
6
- metadata.gz: ba5adc8a3633df76fb78960ed06b266336c829d72ac48df5092dc5eb6fea4061ba4bb738c54aafbc2cedb23b6e638871992363120f0c323a916976e757d4bf0b
7
- data.tar.gz: e23288af3a076eead23bad85f885f4928d5aae4592cef341e6fd4f27ee9e65c6c8464e20c09b6d7a1522512ca70057027a9f40c0201bfa8b4400a6af139b4c3a
6
+ metadata.gz: 3894fec45c2f423348c6926c5bef9c1aff794e5e3d7e11394bd791be74d606ad0ad4e5613c7295b9b4051af3a6f9089a6ac60ade8f86a7a407f4d346fcb80df7
7
+ data.tar.gz: 608590677da050618459e44be516f72b00d9a8e8db7edc2be63fc7622864936db74b429ce013b2e12c75da9d65e5b89b289b49cecf2683803353a2832f45463a
data/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 2.0.5
8
+
9
+ ### Added
10
+
11
+ - Added `isatty` method on loggers for IO compatibility.
12
+
13
+ ## 2.0.4
14
+
15
+ ### Fixed
16
+
17
+ - Hardened multi-threaded context locals handling to ensure compatibility with all Ruby implementations.
18
+
7
19
  ## 2.0.3
8
20
 
9
21
  ### Added
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
1
+ 2.0.5
@@ -49,11 +49,13 @@ module Lumberjack
49
49
 
50
50
  def set_context_locals(&block)
51
51
  scope_id = context_locals_scope_id
52
- current = @context_locals[scope_id] if scope_id
53
- data = Data.new(current)
52
+ current = nil
53
+ data = nil
54
54
 
55
55
  begin
56
56
  @context_locals_mutex.synchronize do
57
+ current = @context_locals[scope_id] if scope_id
58
+ data = Data.new(current)
57
59
  @context_locals[scope_id] = data
58
60
  end
59
61
  yield data
@@ -71,7 +73,10 @@ module Lumberjack
71
73
  def current_context_locals
72
74
  return nil unless defined?(@context_locals)
73
75
 
74
- @context_locals[context_locals_scope_id]
76
+ scope_id = context_locals_scope_id
77
+ @context_locals_mutex.synchronize do
78
+ @context_locals[scope_id]
79
+ end
75
80
  end
76
81
 
77
82
  # Initialize the context locals storage and mutex.
@@ -120,6 +120,14 @@ module Lumberjack
120
120
  false
121
121
  end
122
122
 
123
+ # Alias for tty? to provide complete IO compatibility.
124
+ #
125
+ # @return [Boolean]
126
+ # @api private
127
+ def isatty
128
+ tty?
129
+ end
130
+
123
131
  # Set the encoding for the stream. This method is provided for IO compatibility
124
132
  # but is a no-op since loggers handle encoding internally through their devices
125
133
  # and formatters.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lumberjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand