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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c07a7e9199462f58af29e0245ec0bb1bc2320b2fb0ff0538159d8caf50708d71
4
- data.tar.gz: 7622d420eabaff04e887074aba918a9e25155517641e730a92305eb44de5c911
3
+ metadata.gz: da87370e8ff71d5fdade85cbe868c827ab7317ee694c733ca3bdeff36f5528db
4
+ data.tar.gz: 0b7cefbc98a1ed2de8f9aeee1b323399a5ca3c4b88cad5172090c6ee0c1cb91a
5
5
  SHA512:
6
- metadata.gz: 228f356dfefffa20db989562126ce4d8e2b78584f6c62f1a8750edb8f336b1ea507975cd8963dd895215253b2c1a9bcd765e1f423ae10108219c77922b7e9344
7
- data.tar.gz: 75b761c38aeda80f76778bf1aa9fc3853f6dda8754066f52f9badd1a56373adfb0d4c56483cda69ffc70f97fa64c4ba2efa8c1334903c6398d136989481d5318
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(@subject, output)
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
@@ -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_<LEVEL> env vars.
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_<LEVEL> variables from environment:
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
@@ -98,7 +98,7 @@ module Console
98
98
  end
99
99
  end
100
100
 
101
- UNKNOWN = 'unknown'
101
+ UNKNOWN = :unknown
102
102
 
103
103
  def call(subject = nil, *arguments, name: nil, severity: UNKNOWN, **options, &block)
104
104
  prefix = build_prefix(name || severity.to_s)
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Console
24
- VERSION = "1.15.0"
24
+ VERSION = "1.15.3"
25
25
  end
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.0
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-03-29 00:00:00.000000000 Z
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.8
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