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 +8 -8
- data/lib/lookout/rack/utils/log.rb +3 -1
- data/lib/lookout/rack/utils/version.rb +1 -1
- data/spec/log_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWEzMWFiNWNkNzVhN2NiOWEzZDg5ZGZmYmVjYmMzMDk5Y2M5MjgxOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmE2ZWI2OTVkNjUwZDM1MzkxMGEzYmM2ZmVlYmEyOWQ5ZTJmYjUwMg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTI0NzcyMjJiYzlkMWQ2MmQ0YTNkMjdmNDdlNzUxNTY4YTZiZWQzOGZiMGNm
|
10
|
+
M2ExY2RlYWI1MmQ1M2JiMDk4NzZjMjIwOTgzOTZiNDQ2YjNhMjg0MjE1MTAw
|
11
|
+
ODkwNjVmNzYyMmNmMTk4Zjg0ZGUxOTZlYjFmMTljMjI5ZDhkMDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
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
|
data/spec/log_spec.rb
CHANGED
@@ -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'
|