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 +4 -4
- data/CHANGELOG.md +12 -0
- data/VERSION +1 -1
- data/lib/lumberjack/context_locals.rb +8 -3
- data/lib/lumberjack/io_compatibility.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e1af0567acc694ebd29f04587e9203db03d14958306abd6a691721c918cd024
|
|
4
|
+
data.tar.gz: 0eab429fc4ef909b57cec680fc84ab5cb12fd99a0e986d105d497be9dee97369
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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 =
|
|
53
|
-
data =
|
|
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
|
-
|
|
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.
|