console 1.15.0 → 1.15.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/console/compatible/logger.rb +10 -6
- data/lib/console/resolver.rb +2 -2
- data/lib/console/terminal/logger.rb +1 -1
- data/lib/console/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da87370e8ff71d5fdade85cbe868c827ab7317ee694c733ca3bdeff36f5528db
|
4
|
+
data.tar.gz: 0b7cefbc98a1ed2de8f9aeee1b323399a5ca3c4b88cad5172090c6ee0c1cb91a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 407560cf6aa2cdb48e913feffff8e14a9ebc0bb9efe7f91df4428bc8da957063ecd094135438d6cb9120d84604d338c9feb89faacbcf78f0ef38647b19c1d242
|
7
|
+
data.tar.gz: e1a2e2d2e70957a8feebdcb34c25e86b8364bb40ea907b29eaa5c88f56886f15a3a344cb5e5432210aec23c72f42f1334a48df5af7c325749e5146299c8c12d1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -50,20 +50,20 @@ module Console
|
|
50
50
|
super(nil)
|
51
51
|
|
52
52
|
@progname = subject
|
53
|
-
@logdev = LogDevice.new(
|
53
|
+
@logdev = LogDevice.new(subject, output)
|
54
54
|
end
|
55
55
|
|
56
56
|
def add(severity, message = nil, progname = nil)
|
57
57
|
severity ||= UNKNOWN
|
58
|
-
|
58
|
+
|
59
59
|
if @logdev.nil? or severity < level
|
60
60
|
return true
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
if progname.nil?
|
64
64
|
progname = @progname
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
if message.nil?
|
68
68
|
if block_given?
|
69
69
|
message = yield
|
@@ -72,14 +72,18 @@ module Console
|
|
72
72
|
progname = @progname
|
73
73
|
end
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
@logdev.call(
|
77
77
|
progname, message,
|
78
78
|
severity: format_severity(severity)
|
79
79
|
)
|
80
|
-
|
80
|
+
|
81
81
|
return true
|
82
82
|
end
|
83
|
+
|
84
|
+
def format_severity(value)
|
85
|
+
super.downcase.to_sym
|
86
|
+
end
|
83
87
|
end
|
84
88
|
end
|
85
89
|
end
|
data/lib/console/resolver.rb
CHANGED
@@ -24,7 +24,7 @@ require_relative 'filter'
|
|
24
24
|
|
25
25
|
module Console
|
26
26
|
class Resolver
|
27
|
-
# You can change the log level for different classes using CONSOLE_
|
27
|
+
# You can change the log level for different classes using CONSOLE_$LEVEL env vars.
|
28
28
|
#
|
29
29
|
# e.g. `CONSOLE_WARN=Acorn,Banana CONSOLE_DEBUG=Cat` will set the log level for the classes Acorn and Banana to `warn` and Cat to `debug`. This overrides the default log level.
|
30
30
|
#
|
@@ -36,7 +36,7 @@ module Console
|
|
36
36
|
# @returns [Nil] If there were no custom logging levels specified in the environment.
|
37
37
|
# @returns [Resolver] If there were custom logging levels, then the created resolver is returned.
|
38
38
|
def self.default_resolver(logger, env = ENV)
|
39
|
-
# Find all CONSOLE_
|
39
|
+
# Find all CONSOLE_$LEVEL variables from environment:
|
40
40
|
levels = logger.class::LEVELS
|
41
41
|
.map{|label, level| [level, env["CONSOLE_#{label.upcase}"]&.split(',')]}
|
42
42
|
.to_h
|
data/lib/console/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -42,7 +42,7 @@ cert_chain:
|
|
42
42
|
RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
|
43
43
|
HiLJ8VOFx6w=
|
44
44
|
-----END CERTIFICATE-----
|
45
|
-
date: 2022-
|
45
|
+
date: 2022-05-12 00:00:00.000000000 Z
|
46
46
|
dependencies:
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: fiber-local
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
- !ruby/object:Gem::Version
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
|
-
rubygems_version: 3.3.
|
187
|
+
rubygems_version: 3.3.7
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: Beautiful logging for Ruby.
|
metadata.gz.sig
CHANGED
Binary file
|