rails-callback_log 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c355fe92d45d85b8b9cfc55456401166c13ab836
4
- data.tar.gz: e9f60252e41ebf86cdbc6767993bb03fb24c8a02
3
+ metadata.gz: 5e35dbc7e94c541ced4a75d2c9ba3f22b7caf87e
4
+ data.tar.gz: eaa385a396104f134f1bf1f49003328eeb852d5a
5
5
  SHA512:
6
- metadata.gz: f61b60c7c91c83e134a12f177e5d078ff69d54029b3962aeafc97e5539014d831c16a8d71bdee63474c209644383a4c7d5dd267d6a090bf5b200dab248d43780
7
- data.tar.gz: b7b4bd43e5e8198e7b5b85e9a002427a7d8ec0d30cb8a2478e794b093d106a415b48e6c9adbd46e4f5a3347f906981f503a02ba78085b1f0e94e026ea41bcf48
6
+ metadata.gz: 584fc2fd59119049e709dc18902742cbab4472c2f0f0d6322141acdbb6607cbf169c1999f2f7f848485b83bdb6ab73c86bfd1981154aeef91082168189d42079
7
+ data.tar.gz: e80417518690edae4a3ada9d19ae68af12b2af379be0135734c99492bde337bbdd5f1de9f28dd8a67b0490a5d9a6e2cc7ff805aafbf67a8843cb1d329c7f4d93
@@ -9,6 +9,10 @@ module RailsCallbackLog
9
9
  FILTER = ENV["RAILS_CALLBACK_LOG_FILTER"].present?.freeze
10
10
 
11
11
  class << self
12
+ def logger
13
+ ::Rails.logger || ::Logger.new(STDOUT)
14
+ end
15
+
12
16
  def matches_filter?(str)
13
17
  source_location_filters.any? { |f| str.start_with?(f) }
14
18
  end
@@ -28,7 +32,7 @@ module RailsCallbackLog
28
32
  lambda { |*args, &block|
29
33
  if !::RailsCallbackLog::FILTER ||
30
34
  caller.any? { |line| ::RailsCallbackLog.matches_filter?(line) }
31
- ::Rails.logger.debug(format("Callback: %s", @method_name))
35
+ ::RailsCallbackLog.logger.debug(format("Callback: %s", @method_name))
32
36
  end
33
37
  original_lambda.call(*args, &block)
34
38
  }
@@ -43,7 +47,7 @@ module RailsCallbackLog
43
47
  lambda { |*args, &block|
44
48
  if !::RailsCallbackLog::FILTER ||
45
49
  caller.any? { |line| ::RailsCallbackLog.matches_filter?(line) }
46
- ::Rails.logger.debug(format("Callback: %s", filter))
50
+ ::RailsCallbackLog.logger.debug(format("Callback: %s", filter))
47
51
  end
48
52
  original_lambda.call(*args, &block)
49
53
  }
@@ -1,7 +1,7 @@
1
1
  require "rubygems"
2
2
 
3
3
  module RailsCallbackLog
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
 
6
6
  def self.gem_version
7
7
  ::Gem::Version.new(VERSION)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-callback_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Beck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-02 00:00:00.000000000 Z
11
+ date: 2017-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport