rollbar 0.12.16 → 0.12.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3130e2b2d1b3c726cbca30e0a4e8da37ee7dca3e
4
- data.tar.gz: 8eebb4ee086cf014aeaac40b1ca1fc2077c32c05
3
+ metadata.gz: e3d027a33b4115d70243cffed4280b726a4dc269
4
+ data.tar.gz: 6718be9dc5ae48738dd4c220fb06f9f06a45e990
5
5
  SHA512:
6
- metadata.gz: 5a41834e01227318af18e5255d911af94388897c683c6d63a789937a8d57b747417d9a0305ed563d4de4c506b0b4348c1a15d7abf6ce6d389ad458191f9697a9
7
- data.tar.gz: f5137b1973af0fb0766e91f11e741de5965697c67915335104e54f82d05da029964dcdabb46285dbf11c13beb88d70710747b01b146c18640864493984661419
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
- - [fabsays](https://github.com/fabsays)
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
- logger.info "[Rollbar] Reporting form validation error: #{error} for #{self.to_s}"
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
- # TODO use logger here?
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
- puts "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
27
+ Rollbar.log_info "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
29
28
  elsif exception_data == 'disabled'
30
- puts "[Rollbar] Exception not reported because Rollbar is disabled"
29
+ Rollbar.log_info "[Rollbar] Exception not reported because Rollbar is disabled"
31
30
  elsif exception_data == 'ignored'
32
- puts "[Rollbar] Exception not reported because it was ignored"
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
- rollbar_debug "[Rollbar] Reporting exception: #{exception.message}", :error
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
- rollbar_debug "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
13
+ Rollbar.log_debug "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
14
14
  elsif exception_data == 'disabled'
15
- rollbar_debug "[Rollbar] Exception not reported because Rollbar is disabled"
15
+ Rollbar.log_debug "[Rollbar] Exception not reported because Rollbar is disabled"
16
16
  elsif exception_data == 'ignored'
17
- rollbar_debug "[Rollbar] Exception not reported because it was ignored"
17
+ Rollbar.log_debug "[Rollbar] Exception not reported because it was ignored"
18
18
  end
19
19
  rescue => e
20
- rollbar_debug "[Rollbar] Exception while reporting exception to Rollbar: #{e.message}"
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
@@ -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
- # TODO use logger here?
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
- puts "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
22
+ Rollbar.log_info "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
24
23
  elsif exception_data == 'disabled'
25
- puts "[Rollbar] Exception not reported because Rollbar is disabled"
24
+ Rollbar.log_info "[Rollbar] Exception not reported because Rollbar is disabled"
26
25
  elsif exception_data == 'ignored'
27
- puts "[Rollbar] Exception not reported because it was ignored"
26
+ Rollbar.log_info "[Rollbar] Exception not reported because it was ignored"
28
27
  end
29
28
 
30
29
  # now continue as normal
@@ -13,7 +13,7 @@ module Rollbar
13
13
  @app.call(env)
14
14
  rescue
15
15
  controller = env["action_controller.instance"]
16
- if controller
16
+ if controller and controller.respond_to? :rollbar_person_data
17
17
  env['rollbar.person_data'] = controller.rollbar_person_data
18
18
  end
19
19
  raise
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.12.16"
2
+ VERSION = "0.12.17"
3
3
  end
@@ -9,6 +9,7 @@ describe HomeController do
9
9
  Rollbar.configure do |config|
10
10
  config.access_token = 'aaaabbbbccccddddeeeeffff00001111'
11
11
  config.logger = logger_mock
12
+ config.request_timeout = 60
12
13
  end
13
14
  end
14
15
 
@@ -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`,
@@ -11,6 +11,7 @@ describe HomeController do
11
11
  config.root = ::Rails.root
12
12
  config.framework = "Rails: #{::Rails::VERSION::STRING}"
13
13
  config.logger = logger_mock
14
+ config.request_timeout = 60
14
15
  end
15
16
  end
16
17
 
data/spec/rollbar_spec.rb CHANGED
@@ -865,6 +865,7 @@ describe Rollbar do
865
865
  config.logger = ::Rails.logger
866
866
  config.root = ::Rails.root
867
867
  config.framework = "Rails: #{::Rails::VERSION::STRING}"
868
+ config.request_timeout = 60
868
869
  end
869
870
  end
870
871
 
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.16
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-12 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json