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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b10135713f7777b24e23191888a3341d20e39f4576c3f93fb92e008212c71f1
4
- data.tar.gz: 13d48205904e7bc452621c8f65da454dc7f77c21592318324bbffef2a1bf5bae
3
+ metadata.gz: b8023caa61e185f752a8e1cec7af81ce9a8570c5287df17a4a958fd313563363
4
+ data.tar.gz: 9a11150db987ee52f0e0ae7ac3a2ec7086a7f5430832510d64c10eb865444ac9
5
5
  SHA512:
6
- metadata.gz: 1c721150d177559864111177271517e51f1c52dae5ee8783839ef32ac09f24cfedcd2757f0406fabc10d181d5214521bdfd625b1def340236f74ed51ecf6ecaf
7
- data.tar.gz: adbea6f546bd0dfaa9ba59d45950fdb775f0ea308599a4a50d2aad4353ac7809f8930c4013fdc1d4f9d0ece963728347ba06b726c6e6078ceb68302dde1b721d
6
+ metadata.gz: e366df7c3b382c412fd788aa567e9a88768d8e70beb14e60d08edc85554a041b511a26befe6a3e59e5759aefc27d2db6046a0fd97ce28b63befede5a68f64d34
7
+ data.tar.gz: 87d676b2fda89d82e8e329a10ac5df93e47af226d5da56073bd43f429fdb4f16019214948811f5d825193542cf71f5a09188ec63899b1083a20282ad92bd464e
@@ -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 using a Regular Expression or Proc
273
- raise ":filter must be a Regexp or Proc" unless filter.nil? || filter.is_a?(Regexp) || filter.is_a?(Proc)
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
@@ -1,3 +1,3 @@
1
1
  module SemanticLogger
2
- VERSION = "4.7.3".freeze
2
+ VERSION = "4.7.4".freeze
3
3
  end
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.3
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-10-22 00:00:00.000000000 Z
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.0.8
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