extended_logger 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extended_logger/controls.rb +10 -0
- data/lib/extended_logger/sink.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f704fdee2a7eb383aa5cb2d3a9be31eec5771e7
|
4
|
+
data.tar.gz: 254c1e8950e8d6a6b04a2c667874b08e843fcde6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f74eafcc745d45528526abec4303c3a73bfff27d39e2682c7d3e7c87511c096e662bf0e7e515e4865b69674a804b715d27900f21d2da2170c0ce93428bdb1c68
|
7
|
+
data.tar.gz: 4e2eac9a4fd0b39f8bfa5b9926d6d2eecd0c5e76613531d649801807c2c86e6344da9a6cc292279e62c19c1d68052291819bd9b3910fbc6107beec047d63d65c
|
@@ -79,6 +79,16 @@ class ExtendedLogger
|
|
79
79
|
instance
|
80
80
|
end
|
81
81
|
|
82
|
+
class Color < ExtendedLogger.define Levels::Set.example, :color_scheme => ColorSchemes.example, :format => Formatters::Plain.example
|
83
|
+
def self.example
|
84
|
+
device = StringIO.new
|
85
|
+
|
86
|
+
instance = build device
|
87
|
+
instance.clock = Time::Clock
|
88
|
+
instance
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
82
92
|
class Ruby < ExtendedLogger.define
|
83
93
|
def self.example
|
84
94
|
device = StringIO.new
|
data/lib/extended_logger/sink.rb
CHANGED
@@ -18,7 +18,10 @@ class ExtendedLogger
|
|
18
18
|
device = File.open device, 'a+' if device.is_a? String
|
19
19
|
device.sync = true
|
20
20
|
|
21
|
-
color_scheme
|
21
|
+
if color_scheme == :none or not (device.tty? and device.is_a? StringIO)
|
22
|
+
color_scheme = nil
|
23
|
+
end
|
24
|
+
|
22
25
|
serializer = Serializer.build log_format: format, color_scheme: color_scheme
|
23
26
|
|
24
27
|
instance = new device, levels, serializer
|