multiple_devices_logger 3.2.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/multiple_devices_logger/ignore_exceptions.rb +1 -1
- data/lib/multiple_devices_logger.rb +7 -7
- data/multiple_devices_logger.gemspec +6 -3
- metadata +67 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f55f9ec6a3938af37ab8d0c4cd2ec7d2abf3eed07b9e8f70a242cddcc1fd3f11
|
4
|
+
data.tar.gz: a0478f63d18172edd7a967d40b9b3e7b2d14be0f7b90f95a95655a68afbe77e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68543e3f1097bb4aca08d41e6eb021ac97e58816478e410baf979da669ee734f330506de1eba7ac5e7ebafa44ef839bcd18445b05337f7ea28e01b3c9241c2b2
|
7
|
+
data.tar.gz: fc85c2d9db01fd48c6389ab6d08b502e5886c4d0813aa59631737872532701adcefb1da8694aaf7a3f3255fabe80b5432d9786ddb3c2df770d3b6d1b8059d89c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
4.0.0
|
@@ -12,7 +12,7 @@ class MultipleDevicesLogger
|
|
12
12
|
def ignore_exceptions(*arguments, &block)
|
13
13
|
@ignored_exception_class_names ||= []
|
14
14
|
@ignored_exceptions_procs ||= []
|
15
|
-
@ignored_exceptions_procs <<
|
15
|
+
@ignored_exceptions_procs << proc(&block) if block_given?
|
16
16
|
[arguments].flatten.each do |argument|
|
17
17
|
if argument.respond_to?(:call)
|
18
18
|
@ignored_exceptions_procs << argument
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'active_support/isolated_execution_state'
|
1
2
|
require 'active_support/core_ext/module'
|
2
3
|
require 'active_support/core_ext/string'
|
3
4
|
require 'logger'
|
@@ -40,7 +41,7 @@ class MultipleDevicesLogger < Logger
|
|
40
41
|
end
|
41
42
|
true
|
42
43
|
end
|
43
|
-
|
44
|
+
alias log add
|
44
45
|
|
45
46
|
def add_device(device, *severities)
|
46
47
|
severities = [severities].flatten
|
@@ -82,25 +83,24 @@ class MultipleDevicesLogger < Logger
|
|
82
83
|
super(parse_severity(value))
|
83
84
|
end
|
84
85
|
|
85
|
-
def reopen(
|
86
|
+
def reopen(_ = nil)
|
86
87
|
raise NotImplementedError.new("#{self.class}#reopen")
|
87
88
|
end
|
88
89
|
|
89
90
|
private
|
90
91
|
|
91
|
-
def format_message(
|
92
|
+
def format_message(_severity, _datetime, _progname, _msg)
|
92
93
|
raise NotImplementedError.new("#{self.class}#format_message")
|
93
94
|
end
|
94
95
|
|
95
96
|
def parse_severity(value)
|
96
97
|
int_value = value.is_a?(Integer) ? value : (Integer(value.to_s) rescue nil)
|
97
98
|
return int_value if SEVERITIES.values.include?(int_value)
|
98
|
-
severity = value.to_s
|
99
99
|
SEVERITIES[value.to_s.strip.downcase] || raise(ArgumentError.new("Invalid log severity: #{value.inspect}"))
|
100
100
|
end
|
101
101
|
|
102
102
|
def parse_severities_with_operator(value)
|
103
|
-
if match = value.to_s.strip.match(/^([<>]=?)\s*(.+)$/)
|
103
|
+
if (match = value.to_s.strip.match(/^([<>]=?)\s*(.+)$/))
|
104
104
|
operator = match[1]
|
105
105
|
severity = parse_severity(match[2])
|
106
106
|
return SEVERITIES.values.select { |l| l.send(operator, severity) }
|
@@ -118,5 +118,5 @@ end
|
|
118
118
|
|
119
119
|
require 'multiple_devices_logger/ignore_exceptions'
|
120
120
|
|
121
|
-
MultipleDevicesLogger.
|
122
|
-
Logger::LogDevice.
|
121
|
+
MultipleDevicesLogger.include MultipleDevicesLogger::IgnoreExceptions
|
122
|
+
Logger::LogDevice.include MultipleDevicesLogger::IgnoreExceptions
|
@@ -9,15 +9,18 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.description = 'Logger that support many and different devices for specified levels'
|
10
10
|
s.license = 'MIT'
|
11
11
|
|
12
|
-
s.files =
|
13
|
-
s.executables =
|
12
|
+
s.files = %x(git ls-files | grep -vE '^(spec/|test/|\\.|Gemfile|Rakefile)').split("\n")
|
13
|
+
s.executables = %x(git ls-files -- bin/*).split("\n").map { |f| File.basename(f) }
|
14
14
|
s.require_paths = ['lib']
|
15
15
|
|
16
16
|
s.required_ruby_version = '>= 2.0.0'
|
17
17
|
|
18
|
-
s.add_dependency 'activesupport', '>=
|
18
|
+
s.add_dependency 'activesupport', '>= 7.0.0', '< 8.0.0'
|
19
19
|
|
20
20
|
s.add_development_dependency 'byebug', '>= 9.0.0', '< 12.0.0'
|
21
21
|
s.add_development_dependency 'rake', '>= 12.0.0', '< 14.0.0'
|
22
22
|
s.add_development_dependency 'rspec', '>= 3.5.0', '< 3.11.0'
|
23
|
+
s.add_development_dependency 'rubocop', '>= 1.25.0', '< 2.0.0'
|
24
|
+
s.add_development_dependency 'rubocop-rake', '>= 0.6.0', '< 1.0.0'
|
25
|
+
s.add_development_dependency 'rubocop-rspec', '>= 2.8.0', '< 3.0.0'
|
23
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiple_devices_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Toulotte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 8.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 7.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 8.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: byebug
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,6 +90,66 @@ dependencies:
|
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: 3.11.0
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: rubocop
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 1.25.0
|
100
|
+
- - "<"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 2.0.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.25.0
|
110
|
+
- - "<"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 2.0.0
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: rubocop-rake
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.6.0
|
120
|
+
- - "<"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.0.0
|
123
|
+
type: :development
|
124
|
+
prerelease: false
|
125
|
+
version_requirements: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: 0.6.0
|
130
|
+
- - "<"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 1.0.0
|
133
|
+
- !ruby/object:Gem::Dependency
|
134
|
+
name: rubocop-rspec
|
135
|
+
requirement: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 2.8.0
|
140
|
+
- - "<"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 3.0.0
|
143
|
+
type: :development
|
144
|
+
prerelease: false
|
145
|
+
version_requirements: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: 2.8.0
|
150
|
+
- - "<"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 3.0.0
|
93
153
|
description: Logger that support many and different devices for specified levels
|
94
154
|
email: al@alweb.org
|
95
155
|
executables: []
|
@@ -121,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
181
|
- !ruby/object:Gem::Version
|
122
182
|
version: '0'
|
123
183
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
184
|
+
rubygems_version: 3.3.3
|
125
185
|
signing_key:
|
126
186
|
specification_version: 4
|
127
187
|
summary: Logger than can have many devices
|