lookout-rack-utils 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjJlYWY4YzE4OTliMzhiMDdmOWUyYWNmOGUzMGZmNjU1MTk2ZTFmOQ==
4
+ YWEzMWFiNWNkNzVhN2NiOWEzZDg5ZGZmYmVjYmMzMDk5Y2M5MjgxOA==
5
5
  data.tar.gz: !binary |-
6
- MTBhNTUyN2VjZGU4ZDBmMGI1MmU5ODFhZWU1MWE4MzFmNzUwMjg0NQ==
6
+ NmE2ZWI2OTVkNjUwZDM1MzkxMGEzYmM2ZmVlYmEyOWQ5ZTJmYjUwMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MGVlMTM3ZDc3ZjNlYWIwZDhiODZhYzc2MDQ1ZDg0MTBjODAzMTI1MzkzMWRl
10
- MTVjOWU1OWQ1NGE4NGJhZTMxYWRkYzkzYTk0ZDI5YTZhZjk0MTZmNzFlNmFi
11
- MjJmNzZjOWE3ZTBjMGQyM2ZjODA3YWFjMmRiMmYxNTY1MDgyODU=
9
+ MTI0NzcyMjJiYzlkMWQ2MmQ0YTNkMjdmNDdlNzUxNTY4YTZiZWQzOGZiMGNm
10
+ M2ExY2RlYWI1MmQ1M2JiMDk4NzZjMjIwOTgzOTZiNDQ2YjNhMjg0MjE1MTAw
11
+ ODkwNjVmNzYyMmNmMTk4Zjg0ZGUxOTZlYjFmMTljMjI5ZDhkMDA=
12
12
  data.tar.gz: !binary |-
13
- ODg5OTQ5NGNlNzljMjc5YTk5NzNiMzU0MDc5MGIxMGY4NGVkYzhlMjE3ZTRm
14
- OWZkOTdhYTgyNmRlOTJmOWVjY2NkMmRkMWFiNDVkMWVjYmY0NDg2M2M0Mzc5
15
- MTNkODdlNzRhZDBiOTc2MGRkZGFjOTU1MjViMTczOWEzMDkzZjU=
13
+ YjMxYjJlZTcxNjJlODFjNTJjNGE1MmIxZDA3NjAxNDBhYzUwMWU1ZmEyZTZj
14
+ ZTVjMmU1NGM4NWZlMDBmOWVkMjJmNmY1ODE2OTIwN2NjYjRjMTRkODc4YTU3
15
+ ZDQ0MmFmNzYyY2I2YzIxZGRjODI4MTQxMjM5NmM3ZDgxNjE3ODM=
@@ -95,7 +95,9 @@ module Lookout::Rack::Utils
95
95
  [:debug, :info, :warn, :error, :level].each do |method|
96
96
  define_method(method) do |*args|
97
97
  if defined?(Lookout::Rack::Utils::Graphite)
98
- Lookout::Rack::Utils::Graphite.increment("log.#{method}") unless method == :level
98
+ unless method == :level
99
+ Lookout::Rack::Utils::Graphite.increment("log.#{method}") unless (configatron.statsd.exclude_levels || []).include?(method)
100
+ end
99
101
  end
100
102
  @logger.send(method, *args)
101
103
  end
@@ -1,7 +1,7 @@
1
1
  module Lookout
2
2
  module Rack
3
3
  module Utils
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
6
6
  end
7
7
  end
@@ -12,6 +12,16 @@ describe Lookout::Rack::Utils::Log do
12
12
  end
13
13
 
14
14
  describe '.debug' do
15
+ context 'if debug is in configatron.statsd.exclude_levels' do
16
+ before { configatron.statsd.exclude_levels = [:debug] }
17
+ after { configatron.statsd.exclude_levels = [] }
18
+
19
+ it 'should not log a graphite stat' do
20
+ Lookout::Rack::Utils::Graphite.should_not_receive(:increment).with('log.debug')
21
+ log.debug 'foo'
22
+ end
23
+ end
24
+
15
25
  it 'should log a graphite stat' do
16
26
  Lookout::Rack::Utils::Graphite.should_receive(:increment).with('log.debug')
17
27
  log.debug 'foo'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookout-rack-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Smith