rollbar 0.12.16 → 0.12.17
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/THANKS.md +4 -1
- data/lib/rollbar.rb +36 -28
- data/lib/rollbar/active_record_extension.rb +1 -1
- data/lib/rollbar/better_errors.rb +4 -5
- data/lib/rollbar/exception_reporter.rb +5 -13
- data/lib/rollbar/goalie.rb +4 -5
- data/lib/rollbar/middleware/rails/rollbar_request_store.rb +1 -1
- data/lib/rollbar/version.rb +1 -1
- data/spec/controllers/home_controller_spec.rb +1 -0
- data/spec/dummyapp/config/initializers/rollbar.rb +1 -0
- data/spec/requests/home_spec.rb +1 -0
- data/spec/rollbar_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3d027a33b4115d70243cffed4280b726a4dc269
|
4
|
+
data.tar.gz: 6718be9dc5ae48738dd4c220fb06f9f06a45e990
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6e16401feb719f6f2c270db7f478d23e125ed2b86ded864ffd9f4bfcad1a151cf4b6d9f0e725bfaf6b539a3bc8daa3af243ba4d85b029f8b75b3a5483e63e9b
|
7
|
+
data.tar.gz: c7f031fdb97c8a935b302ed6531e815d11dee411b11f0b7ba7dcfe4f8f427aa18941e72ce5dcd3780e573ac3a96e5d123cec758fac3dbd302b1d792e62273393
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
**0.12.17**
|
4
|
+
- Replace usage of `puts` with a configurable logger in different areas of the notifier
|
5
|
+
- Fix error in `RollbarRequestStore` when `rollbar_person_data` isn't defined for a controller
|
6
|
+
|
3
7
|
**0.12.16**
|
4
8
|
- Scrub fields are now converted to a regular expression for broader param name matching
|
5
9
|
- Save ActionDispatch request_id in reports if present
|
data/THANKS.md
CHANGED
@@ -10,19 +10,22 @@ Huge thanks to the following contributors (by github username). For the most up-
|
|
10
10
|
- [derekrockwell](https://github.com/derekrockwell)
|
11
11
|
- [dimko](https://github.com/dimko)
|
12
12
|
- [dlackty](https://github.com/dlackty)
|
13
|
-
- [
|
13
|
+
- [fab](https://github.com/fab)
|
14
14
|
- [firstbanco](https://github.com/firstbanco)
|
15
|
+
- [Florent2](https://github.com/Florent2)
|
15
16
|
- [ixti](https://github.com/ixti)
|
16
17
|
- [jeremyvdw](https://github.com/jeremyvdw)
|
17
18
|
- [johnknott](https://github.com/johnknott)
|
18
19
|
- [JoshuaOSHickman](https://github.com/JoshuaOSHickman)
|
19
20
|
- [juggler](https://github.com/juggler)
|
20
21
|
- [kavu](https://github.com/kavu)
|
22
|
+
- [lanej](https://github.com/lanej)
|
21
23
|
- [magnolia-fan](https://github.com/magnolia-fan)
|
22
24
|
- [mauricio](https://github.com/mauricio)
|
23
25
|
- [metaskills](https://github.com/metaskills)
|
24
26
|
- [miloops](https://github.com/miloops)
|
25
27
|
- [mipearson](https://github.com/mipearson)
|
28
|
+
- [mrgordon](https://github.com/mrgordon)
|
26
29
|
- [petergoldstein](https://github.com/petergoldstein)
|
27
30
|
- [pmen](https://github.com/pmen)
|
28
31
|
- [rogercampos](https://github.com/rogercampos)
|
data/lib/rollbar.rb
CHANGED
@@ -189,6 +189,42 @@ module Rollbar
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
+
# wrappers around logger methods
|
193
|
+
def log_error(message)
|
194
|
+
begin
|
195
|
+
logger.error message
|
196
|
+
rescue => e
|
197
|
+
puts "[Rollbar] Error logging error:"
|
198
|
+
puts "[Rollbar] #{message}"
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
def log_info(message)
|
203
|
+
begin
|
204
|
+
logger.info message
|
205
|
+
rescue => e
|
206
|
+
puts "[Rollbar] Error logging info:"
|
207
|
+
puts "[Rollbar] #{message}"
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def log_warning(message)
|
212
|
+
begin
|
213
|
+
logger.warn message
|
214
|
+
rescue => e
|
215
|
+
puts "[Rollbar] Error logging warning:"
|
216
|
+
puts "[Rollbar] #{message}"
|
217
|
+
end
|
218
|
+
end
|
219
|
+
def log_debug(message)
|
220
|
+
begin
|
221
|
+
logger.debug message
|
222
|
+
rescue => e
|
223
|
+
puts "[Rollbar] Error logging debug"
|
224
|
+
puts "[Rollbar] #{message}"
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
192
228
|
private
|
193
229
|
|
194
230
|
def attach_request_data(payload, request_data)
|
@@ -488,34 +524,6 @@ module Rollbar
|
|
488
524
|
end
|
489
525
|
end
|
490
526
|
|
491
|
-
# wrappers around logger methods
|
492
|
-
def log_error(message)
|
493
|
-
begin
|
494
|
-
logger.error message
|
495
|
-
rescue => e
|
496
|
-
puts "[Rollbar] Error logging error:"
|
497
|
-
puts "[Rollbar] #{message}"
|
498
|
-
end
|
499
|
-
end
|
500
|
-
|
501
|
-
def log_info(message)
|
502
|
-
begin
|
503
|
-
logger.info message
|
504
|
-
rescue => e
|
505
|
-
puts "[Rollbar] Error logging info:"
|
506
|
-
puts "[Rollbar] #{message}"
|
507
|
-
end
|
508
|
-
end
|
509
|
-
|
510
|
-
def log_warning(message)
|
511
|
-
begin
|
512
|
-
logger.warn message
|
513
|
-
rescue => e
|
514
|
-
puts "[Rollbar] Error logging warning:"
|
515
|
-
puts "[Rollbar] #{message}"
|
516
|
-
end
|
517
|
-
end
|
518
|
-
|
519
527
|
# Reports an internal error in the Rollbar library. This will be reported within the configured
|
520
528
|
# Rollbar project. We'll first attempt to provide a report including the exception traceback.
|
521
529
|
# If that fails, we'll fall back to a more static failsafe response.
|
@@ -4,7 +4,7 @@ module Rollbar
|
|
4
4
|
|
5
5
|
def report_validation_errors_to_rollbar
|
6
6
|
self.errors.full_messages.each do |error|
|
7
|
-
|
7
|
+
Rollbar.log_info "[Rollbar] Reporting form validation error: #{error} for #{self.to_s}"
|
8
8
|
Rollbar.report_message("Form Validation Error: #{error} for #{self.to_s}")
|
9
9
|
end
|
10
10
|
end
|
@@ -17,19 +17,18 @@ module BetterErrors
|
|
17
17
|
person_data = controller.rollbar_person_data rescue nil
|
18
18
|
exception_data = Rollbar.report_exception(exception, request_data, person_data)
|
19
19
|
rescue => e
|
20
|
-
|
21
|
-
puts "[Rollbar] Exception while reporting exception to Rollbar: #{e}"
|
20
|
+
Rollbar.log_warning "[Rollbar] Exception while reporting exception to Rollbar: #{e}"
|
22
21
|
end
|
23
22
|
|
24
23
|
# if an exception was reported, save uuid in the env
|
25
24
|
# so it can be displayed to the user on the error page
|
26
25
|
if exception_data.is_a?(Hash)
|
27
26
|
env['rollbar.exception_uuid'] = exception_data[:uuid]
|
28
|
-
|
27
|
+
Rollbar.log_info "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
|
29
28
|
elsif exception_data == 'disabled'
|
30
|
-
|
29
|
+
Rollbar.log_info "[Rollbar] Exception not reported because Rollbar is disabled"
|
31
30
|
elsif exception_data == 'ignored'
|
32
|
-
|
31
|
+
Rollbar.log_info "[Rollbar] Exception not reported because it was ignored"
|
33
32
|
end
|
34
33
|
|
35
34
|
# now continue as normal
|
@@ -3,29 +3,21 @@ module Rollbar
|
|
3
3
|
include RequestDataExtractor
|
4
4
|
|
5
5
|
def report_exception_to_rollbar(env, exception)
|
6
|
-
|
6
|
+
Rollbar.log_error "Reporting exception: #{exception.message}"
|
7
7
|
request_data = extract_request_data_from_rack(env)
|
8
8
|
person_data = extract_person_data_from_controller(env)
|
9
9
|
exception_data = Rollbar.report_exception(exception, request_data, person_data)
|
10
10
|
|
11
11
|
if exception_data.is_a?(Hash)
|
12
12
|
env['rollbar.exception_uuid'] = exception_data[:uuid]
|
13
|
-
|
13
|
+
Rollbar.log_debug "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
|
14
14
|
elsif exception_data == 'disabled'
|
15
|
-
|
15
|
+
Rollbar.log_debug "[Rollbar] Exception not reported because Rollbar is disabled"
|
16
16
|
elsif exception_data == 'ignored'
|
17
|
-
|
17
|
+
Rollbar.log_debug "[Rollbar] Exception not reported because it was ignored"
|
18
18
|
end
|
19
19
|
rescue => e
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
def rollbar_debug(message, level = :debug)
|
24
|
-
if defined?(Rails)
|
25
|
-
::Rails.logger.send(level, message)
|
26
|
-
else
|
27
|
-
puts message
|
28
|
-
end
|
20
|
+
Rollbar.log_debug "[Rollbar] Exception while reporting exception to Rollbar: #{e.message}"
|
29
21
|
end
|
30
22
|
end
|
31
23
|
end
|
data/lib/rollbar/goalie.rb
CHANGED
@@ -12,19 +12,18 @@ module Goalie
|
|
12
12
|
person_data = controller.rollbar_person_data rescue nil
|
13
13
|
exception_data = Rollbar.report_exception(exception, request_data, person_data)
|
14
14
|
rescue => e
|
15
|
-
|
16
|
-
puts "[Rollbar] Exception while reporting exception to Rollbar: #{e}"
|
15
|
+
Rollbar.log_warning "[Rollbar] Exception while reporting exception to Rollbar: #{e}"
|
17
16
|
end
|
18
17
|
|
19
18
|
# if an exception was reported, save uuid in the env
|
20
19
|
# so it can be displayed to the user on the error page
|
21
20
|
if exception_data.is_a?(Hash)
|
22
21
|
env['rollbar.exception_uuid'] = exception_data[:uuid]
|
23
|
-
|
22
|
+
Rollbar.log_info "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
|
24
23
|
elsif exception_data == 'disabled'
|
25
|
-
|
24
|
+
Rollbar.log_info "[Rollbar] Exception not reported because Rollbar is disabled"
|
26
25
|
elsif exception_data == 'ignored'
|
27
|
-
|
26
|
+
Rollbar.log_info "[Rollbar] Exception not reported because it was ignored"
|
28
27
|
end
|
29
28
|
|
30
29
|
# now continue as normal
|
data/lib/rollbar/version.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rollbar/rails'
|
2
2
|
Rollbar.configure do |config|
|
3
3
|
config.access_token = 'aaaabbbbccccddddeeeeffff00001111'
|
4
|
+
config.request_timeout = 60
|
4
5
|
|
5
6
|
# By default, Rollbar will try to call the `current_user` controller method
|
6
7
|
# to fetch the logged-in user object, and then call that object's `id`,
|
data/spec/requests/home_spec.rb
CHANGED
data/spec/rollbar_spec.rb
CHANGED
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.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Rue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|