semantic_logger 4.7.3 → 4.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/semantic_logger/base.rb +11 -3
- data/lib/semantic_logger/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8023caa61e185f752a8e1cec7af81ce9a8570c5287df17a4a958fd313563363
|
4
|
+
data.tar.gz: 9a11150db987ee52f0e0ae7ac3a2ec7086a7f5430832510d64c10eb865444ac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e366df7c3b382c412fd788aa567e9a88768d8e70beb14e60d08edc85554a041b511a26befe6a3e59e5759aefc27d2db6046a0fd97ce28b63befede5a68f64d34
|
7
|
+
data.tar.gz: 87d676b2fda89d82e8e329a10ac5df93e47af226d5da56073bd43f429fdb4f16019214948811f5d825193542cf71f5a09188ec63899b1083a20282ad92bd464e
|
data/lib/semantic_logger/base.rb
CHANGED
@@ -263,14 +263,22 @@ module SemanticLogger
|
|
263
263
|
# For example if set to :warn, this appender would only log :warn and :fatal
|
264
264
|
# log messages when other appenders could be logging :info and lower
|
265
265
|
#
|
266
|
-
# filter [Regexp|Proc]
|
266
|
+
# filter [Regexp|Proc|Module]
|
267
267
|
# RegExp: Only include log messages where the class name matches the supplied
|
268
268
|
# regular expression. All other messages will be ignored
|
269
269
|
# Proc: Only include log messages where the supplied Proc returns true
|
270
270
|
# The Proc must return true or false
|
271
|
+
# Module: A module that implements `.call`. For example:
|
272
|
+
# module ComplexFilter
|
273
|
+
# def self.call(log)
|
274
|
+
# (/\AExclude/ =~ log.message).nil?
|
275
|
+
# end
|
276
|
+
# end
|
271
277
|
def initialize(klass, level = nil, filter = nil)
|
272
|
-
# Support filtering all messages to this logger
|
273
|
-
|
278
|
+
# Support filtering all messages to this logger instance.
|
279
|
+
unless filter.nil? || filter.is_a?(Regexp) || filter.is_a?(Proc) || filter.respond_to?(:call)
|
280
|
+
raise ":filter must be a Regexp, Proc, or implement :call"
|
281
|
+
end
|
274
282
|
|
275
283
|
@filter = filter.is_a?(Regexp) ? filter.freeze : filter
|
276
284
|
@name = klass.is_a?(String) ? klass : klass.name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.7.
|
4
|
+
version: 4.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
111
|
+
rubygems_version: 3.1.4
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Feature rich logging framework, and replacement for existing Ruby & Rails
|