ruby_smart-simple_logger 1.2.0 → 1.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4f5d3ae3592f31b6c012044205c37d859c9e809d58f8cce63c7b6b2ed634829
|
4
|
+
data.tar.gz: d50becd65a8386e2466ddebcbbbd6bf2ec92aad95f4c5ae76288974429d607bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe6aab96f5a2f67f85fd5147462d65e0f8496a1271406710f4d9e8b5df3a245c8f7e1292a9ac3f548973a204442332abafe21a8a97b6724f25a513b3eef7148
|
7
|
+
data.tar.gz: 5165beba92525197a3d9359bc7513c15e4aa6057a3bea5902870541141fe9ca4fdb3b4f6270eefcbbbf7ca75aff209e03cf39d4d8eb00d34e3292a45e71960ad
|
data/docs/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# RubySmart::SimpleLogger - CHANGELOG
|
2
2
|
|
3
|
+
## [1.2.1] - 2023-02-17
|
4
|
+
* **[fix]** 'rails'-related builtins
|
5
|
+
* **[fix]** `::RubySmart::SimpleLogger::Devices::MultiDevice` register `MultiDevice` instead of nested devices
|
6
|
+
|
3
7
|
## [1.2.0] - 2023-02-16
|
4
8
|
* **[add]** multi-'builtins' support
|
5
9
|
* **[ref]** `Logger` initialization - now supports to provide multiple builtins
|
@@ -53,10 +53,15 @@ module RubySmart
|
|
53
53
|
#
|
54
54
|
# @param [Object] dev
|
55
55
|
def register(dev, formatter = nil)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
# check device, to prevent nested sets of +MultiDevice+
|
57
|
+
if dev.is_a?(MultiDevice)
|
58
|
+
@devices += dev.devices
|
59
|
+
else
|
60
|
+
@devices << {
|
61
|
+
dev: dev,
|
62
|
+
formatter: formatter
|
63
|
+
}
|
64
|
+
end
|
60
65
|
|
61
66
|
self
|
62
67
|
end
|
@@ -136,7 +136,7 @@ module RubySmart
|
|
136
136
|
if ::ThreadInfo.stdout?
|
137
137
|
_resolve_device(:stdout, opts)
|
138
138
|
elsif ::ThreadInfo.rails? && ::Rails.logger
|
139
|
-
_resolve_device(:
|
139
|
+
_resolve_device(:rails, opts)
|
140
140
|
else
|
141
141
|
_resolve_device(:memory, opts)
|
142
142
|
end
|
@@ -145,7 +145,16 @@ module RubySmart
|
|
145
145
|
when :stderr
|
146
146
|
STDERR
|
147
147
|
when :rails
|
148
|
-
|
148
|
+
raise "Unable to build SimpleLogger with 'rails' builtin for not initialized rails application!" unless ThreadInfo.rails?
|
149
|
+
|
150
|
+
# special check for rails-with-console (IRB -> STDOUT) combination - mostly in combination with +Debase+.
|
151
|
+
if ThreadInfo.console? && ::Rails.logger.instance_variable_get(:@logdev).dev != STDOUT
|
152
|
+
::RubySmart::SimpleLogger::Devices::MultiDevice
|
153
|
+
.register(_resolve_device(:stdout, opts))
|
154
|
+
.register(::Rails.logger.instance_variable_get(:@logdev).dev)
|
155
|
+
else
|
156
|
+
::Rails.logger.instance_variable_get(:@logdev).dev
|
157
|
+
end
|
149
158
|
when :proc
|
150
159
|
# force overwrite opts
|
151
160
|
@ignore_payload = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_smart-simple_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Gonsior
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby_smart-support
|