rollbar 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +12 -1
- data/lib/rollbar/configuration.rb +0 -5
- data/lib/rollbar/version.rb +1 -1
- data/lib/rollbar.rb +2 -2
- data/rollbar.gemspec +1 -1
- data/spec/rollbar_spec.rb +15 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7607d520d1f8d963e790e8923de6639077d1b249
|
4
|
+
data.tar.gz: d09eee4f299f4d0a84c3b2458416852bd9f56eb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f84dbc19fa80b6b7df3292913acfc8a02d39092baacd9288a28f9d40e7725e0c72338d720168f3d7d185a599370a42b2c9fb2589cde770eb19064fb4a587c2f
|
7
|
+
data.tar.gz: 9302c823401d4a4a3545bc51059e4e9070fbb8522a5a9deb0d7d3424a2aa99e77624de12e688cb63e9f532576df648ff7d7cc10d6084caff231caa983aaac031
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -95,10 +95,21 @@ rescue Exception => e
|
|
95
95
|
end
|
96
96
|
```
|
97
97
|
|
98
|
+
Exceptions are reported with an "error" level by default. You can override the level by passing it in as the fourth argument:
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
begin
|
102
|
+
foo = bar
|
103
|
+
rescue Exception => e
|
104
|
+
# all levels: debug, info, warning, error, critical
|
105
|
+
Rollbar.report_exception(e, rollbar_request_data, rollbar_person_data, "warning")
|
106
|
+
end
|
107
|
+
|
108
|
+
```
|
109
|
+
|
98
110
|
You can also log individual messages:
|
99
111
|
|
100
112
|
```ruby
|
101
|
-
# logs at the 'warning' level. all levels: debug, info, warning, error, critical
|
102
113
|
Rollbar.report_message("Unexpected input", "warning")
|
103
114
|
|
104
115
|
# default level is "info"
|
@@ -22,8 +22,6 @@ module Rollbar
|
|
22
22
|
attr_accessor :person_email_method
|
23
23
|
attr_accessor :root
|
24
24
|
attr_accessor :scrub_fields
|
25
|
-
attr_accessor :use_sidekiq
|
26
|
-
attr_accessor :use_sucker_punch
|
27
25
|
attr_accessor :use_async
|
28
26
|
attr_accessor :use_eventmachine
|
29
27
|
attr_accessor :web_base
|
@@ -56,8 +54,6 @@ module Rollbar
|
|
56
54
|
@scrub_fields = [:passwd, :password, :password_confirmation, :secret,
|
57
55
|
:confirm_password, :password_confirmation, :secret_token]
|
58
56
|
@use_async = false
|
59
|
-
@use_sidekiq = false
|
60
|
-
@use_sucker_punch = false
|
61
57
|
@use_eventmachine = false
|
62
58
|
@web_base = DEFAULT_WEB_BASE
|
63
59
|
@write_to_file = false
|
@@ -66,7 +62,6 @@ module Rollbar
|
|
66
62
|
def use_sidekiq(options = {})
|
67
63
|
require 'rollbar/delay/sidekiq' if defined?(Sidekiq)
|
68
64
|
@use_async = true
|
69
|
-
@use_sidekiq = true
|
70
65
|
@async_handler = Rollbar::Delay::Sidekiq.new(options)
|
71
66
|
end
|
72
67
|
|
data/lib/rollbar/version.rb
CHANGED
data/lib/rollbar.rb
CHANGED
@@ -73,11 +73,11 @@ module Rollbar
|
|
73
73
|
# `rollbar_request_data`.
|
74
74
|
# @param person_data [Hash] Data describing the affected person. Should be the result of calling
|
75
75
|
# `rollbar_person_data`
|
76
|
-
def report_exception(exception, request_data = nil, person_data = nil)
|
76
|
+
def report_exception(exception, request_data = nil, person_data = nil, level = nil)
|
77
77
|
return 'disabled' unless configuration.enabled
|
78
78
|
return 'ignored' if ignored?(exception)
|
79
79
|
|
80
|
-
data = exception_data(exception, filtered_level(exception))
|
80
|
+
data = exception_data(exception, level ? level : filtered_level(exception))
|
81
81
|
if request_data
|
82
82
|
request_data[:env].reject!{|k, v| v.is_a?(IO) } if request_data[:env]
|
83
83
|
data[:request] = request_data
|
data/rollbar.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Rollbar::VERSION
|
17
17
|
|
18
|
-
gem.add_runtime_dependency 'multi_json', '~> 1.
|
18
|
+
gem.add_runtime_dependency 'multi_json', '~> 1.3'
|
19
19
|
|
20
20
|
gem.add_development_dependency 'rails', '>= 3.0.0'
|
21
21
|
gem.add_development_dependency 'rspec-rails', '~> 2.12.0'
|
data/spec/rollbar_spec.rb
CHANGED
@@ -199,6 +199,21 @@ describe Rollbar do
|
|
199
199
|
|
200
200
|
payload["data"]["body"]["trace"]["frames"][0]["method"].should == "custom backtrace line"
|
201
201
|
end
|
202
|
+
|
203
|
+
it 'should report exceptions with a custom level' do
|
204
|
+
payload = nil
|
205
|
+
Rollbar.stub(:schedule_payload) do |*args|
|
206
|
+
payload = MultiJson.load(args[0])
|
207
|
+
end
|
208
|
+
|
209
|
+
Rollbar.report_exception(@exception)
|
210
|
+
|
211
|
+
payload["data"]["level"].should == 'error'
|
212
|
+
|
213
|
+
Rollbar.report_exception(@exception, nil, nil, 'debug')
|
214
|
+
|
215
|
+
payload["data"]["level"].should == 'debug'
|
216
|
+
end
|
202
217
|
end
|
203
218
|
|
204
219
|
context 'report_message' 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.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Rue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|