rollbar 0.10.14 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +6 -0
- data/THANKS.md +1 -0
- data/lib/generators/rollbar/templates/initializer.rb +3 -0
- data/lib/rollbar.rb +6 -1
- data/lib/rollbar/configuration.rb +1 -1
- data/lib/rollbar/version.rb +1 -1
- data/spec/rollbar_spec.rb +21 -2
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGYzZDgyZWI3ZjA4NTkzNDQxYWQ4ZDMzMmE2MjQ5M2E4MTQ5ODExMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWFlZWY4MzU5MDE5ZTgxYzhjODM5ZDdmYmM1ZmY1YzhkNjY5NmI1Mg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODNlYjc0YTg4YWEzZDUwNDE5MDZmZDA4OTI4NThhNjk2ZTQ0MGEyNjY1ZmEw
|
10
|
+
MDI4YTFmZWE4NTJmZWJkNGJiOWYzYmQxOWU1Yzk0ZmI1NDMxZjVlYjNkNDE5
|
11
|
+
ZDQyYmE3NmI4MmEyZTViYzFkMmJlMmU1MTlhYWY1M2JkZGY3NDY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjIyODY2ZTkyZTIzOWZkMDNjODQxYWZhNGU5Yzg4NWM4NmI4YmE4YjU4YThh
|
14
|
+
MGY5NmQ4MjZhMGYzNjgxMDQ0OGE0NTJjMTZkYTU0MDc0NzhjYTE1ODU2NmEy
|
15
|
+
ZjZkNGI5OTVjYTU5MTNhN2U1ZDQzMWE4ODM2NjA1NjNjY2UyMGM=
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
**0.11.1**
|
4
|
+
- `config.exception_level_filters` can now take a callable instead of a string. The exception instance will be passed to the callable.
|
5
|
+
|
6
|
+
**0.11.0**
|
7
|
+
- Changed default environment name from `'production'` to `'unspecified'`
|
8
|
+
|
3
9
|
**0.10.14**
|
4
10
|
- Fixed compatability issue with better_errors 1.0
|
5
11
|
|
data/THANKS.md
CHANGED
@@ -4,6 +4,7 @@ Huge thanks to the following contributors (by github username). For the most up-
|
|
4
4
|
|
5
5
|
- [arr-ee](https://github.com/arr-ee)
|
6
6
|
- [awmichel](https://github.com/awmichel)
|
7
|
+
- [bradx3](https://github.com/bradx3)
|
7
8
|
- [dimko](https://github.com/dimko)
|
8
9
|
- [dlackty](https://github.com/dlackty)
|
9
10
|
- [fabsays](https://github.com/fabsays)
|
@@ -28,6 +28,9 @@ Rollbar.configure do |config|
|
|
28
28
|
# Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
|
29
29
|
# 'ignore' will cause the exception to not be reported at all.
|
30
30
|
# config.exception_level_filters.merge!('MyCriticalException' => 'critical')
|
31
|
+
#
|
32
|
+
# You can also specify a callable, which will be called with the exception instance.
|
33
|
+
# config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' })
|
31
34
|
|
32
35
|
# Enable asynchronous reporting (uses girl_friday or Threading if girl_friday
|
33
36
|
# is not installed)
|
data/lib/rollbar.rb
CHANGED
@@ -174,7 +174,12 @@ module Rollbar
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def filtered_level(exception)
|
177
|
-
configuration.exception_level_filters[exception.class.name]
|
177
|
+
filter = configuration.exception_level_filters[exception.class.name]
|
178
|
+
if filter.respond_to?(:call)
|
179
|
+
filter.call(exception)
|
180
|
+
else
|
181
|
+
filter
|
182
|
+
end
|
178
183
|
end
|
179
184
|
|
180
185
|
def message_data(message, level, extra_data)
|
@@ -41,7 +41,7 @@ module Rollbar
|
|
41
41
|
@default_logger = lambda { Logger.new(STDERR) }
|
42
42
|
@enabled = nil # set to true when configure is called
|
43
43
|
@endpoint = DEFAULT_ENDPOINT
|
44
|
-
@environment = '
|
44
|
+
@environment = 'unspecified'
|
45
45
|
@exception_level_filters = {
|
46
46
|
'ActiveRecord::RecordNotFound' => 'warning',
|
47
47
|
'AbstractController::ActionNotFound' => 'warning',
|
data/lib/rollbar/version.rb
CHANGED
data/spec/rollbar_spec.rb
CHANGED
@@ -127,6 +127,25 @@ describe Rollbar do
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
it 'should allow callables to set exception filtered level' do
|
131
|
+
callable_mock = double
|
132
|
+
saved_filters = Rollbar.configuration.exception_level_filters
|
133
|
+
Rollbar.configure do |config|
|
134
|
+
config.exception_level_filters = { 'NameError' => callable_mock }
|
135
|
+
end
|
136
|
+
|
137
|
+
callable_mock.should_receive(:call).with(@exception).at_least(:once).and_return("info")
|
138
|
+
logger_mock.should_receive(:info)
|
139
|
+
logger_mock.should_not_receive(:warn)
|
140
|
+
logger_mock.should_not_receive(:error)
|
141
|
+
|
142
|
+
Rollbar.report_exception(@exception)
|
143
|
+
|
144
|
+
Rollbar.configure do |config|
|
145
|
+
config.exception_level_filters = saved_filters
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
130
149
|
it 'should not report exceptions when silenced' do
|
131
150
|
Rollbar.should_not_receive :schedule_payload
|
132
151
|
|
@@ -552,9 +571,9 @@ describe Rollbar do
|
|
552
571
|
data[:framework].should match(/^Rails/)
|
553
572
|
end
|
554
573
|
|
555
|
-
it 'should have
|
574
|
+
it 'should have default environment "unspecified"' do
|
556
575
|
data = Rollbar.send(:base_data)
|
557
|
-
data[:environment].should == '
|
576
|
+
data[:environment].should == 'unspecified'
|
558
577
|
end
|
559
578
|
|
560
579
|
it 'should have an overridden environment' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Rue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -305,4 +305,3 @@ test_files:
|
|
305
305
|
- spec/requests/home_spec.rb
|
306
306
|
- spec/rollbar_spec.rb
|
307
307
|
- spec/spec_helper.rb
|
308
|
-
has_rdoc:
|