raygun4ruby 2.5.0 → 2.6.0

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: 1b5dc6fa5ba97eb5e725e33957adb0938d497c04
4
- data.tar.gz: d8251293800014da04f65d59a7de524310bf0575
3
+ metadata.gz: 12ad609c25703e38bf187602b1eeb27ed13f9fdb
4
+ data.tar.gz: 5af743e3db72f0339669b255328d8256be2c6314
5
5
  SHA512:
6
- metadata.gz: a7e838b56806115af7f151908b8323c106677de99764b4fe0a30939cc15e9a529f34193643c3173d02ccd65c60b8492cd96b934f317f3b44f46827463d86a8b1
7
- data.tar.gz: 362c3b34876de277572b93e7c4017adee6222839a3e1c711c7cf20181438501d302446d95735c4d8f61b719ae2dbfdc93428ef4ce61276158a6505e0d062854a
6
+ metadata.gz: 070d775307e84cd705e14c6c6a245d4508c8dfcb95991da06ef62e825255a12fde096808e27d65a11bc2c2e20e892270f3e005eb65a4c9280575075ed3a45bdc
7
+ data.tar.gz: 9b011bb6ca157c9fbcd0283721d40a48e90e857425c7055ad93f1445c98eb9c5103c3d7a6bbb2a6e18059bfbf2181d7b66e14c8a0a5ef65782ac84cf6dfcfbe9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 2.6.0 (25/10/2017)
2
+
3
+ Features
4
+ - Enhanced debug logging to assist in resolving issues from support requests ([#128](https://github.com/MindscapeHQ/raygun4ruby/pull/128))
5
+
1
6
  ## 2.5.0 (04/10/2017)
2
7
 
3
8
  Features
@@ -5,7 +10,7 @@ Features
5
10
 
6
11
  Bugfixes
7
12
  - Fix crash when recording breadcrumb with uninitialized store ([#126](https://github.com/MindscapeHQ/raygun4ruby/pull/126))
8
- - Make raw data handling more robus and fix in unicorn ([#125](https://github.com/MindscapeHQ/raygun4ruby/pull/125))
13
+ - Make raw data handling more robust and fix in unicorn ([#125](https://github.com/MindscapeHQ/raygun4ruby/pull/125))
9
14
  - Backwards compatible affected_user_identifier_methods ([#120](https://github.com/MindscapeHQ/raygun4ruby/pull/120))
10
15
 
11
16
  ## 2.4.1 (29/08/2017)
data/lib/raygun/client.rb CHANGED
@@ -90,6 +90,8 @@ module Raygun
90
90
  end
91
91
 
92
92
  def request_information(env)
93
+ Raygun.log('retrieving request information')
94
+
93
95
  return {} if env.nil? || env.empty?
94
96
  {
95
97
  hostName: env["SERVER_NAME"],
@@ -118,6 +120,8 @@ module Raygun
118
120
  end
119
121
 
120
122
  def form_params(env)
123
+ Raygun.log('retrieving form params')
124
+
121
125
  params = action_dispatch_params(env) || rack_params(env) || {}
122
126
  filter_params_with_blacklist(params, env["action_dispatch.parameter_filter"])
123
127
  end
@@ -132,10 +136,12 @@ module Raygun
132
136
  end
133
137
 
134
138
  def raw_data(rack_env)
139
+ Raygun.log('retrieving raw data')
135
140
  request = Rack::Request.new(rack_env)
136
141
 
137
142
  return unless Raygun.configuration.record_raw_data
138
143
  return if request.get?
144
+ Raygun.log('passed raw_data checks')
139
145
 
140
146
  input = rack_env['rack.input']
141
147
 
@@ -158,6 +164,7 @@ module Raygun
158
164
 
159
165
  # see http://raygun.io/raygun-providers/rest-json-api?v=1
160
166
  def build_payload_hash(exception_instance, env = {}, user = nil)
167
+ Raygun.log('building payload hash')
161
168
  custom_data = filter_custom_data(env) || {}
162
169
  exception_custom_data = if exception_instance.respond_to?(:raygun_custom_data)
163
170
  exception_instance.raygun_custom_data
@@ -180,6 +187,8 @@ module Raygun
180
187
  configuration_tags = Raygun.configuration.tags
181
188
  end
182
189
 
190
+ Raygun.log('set tags')
191
+
183
192
  grouping_key = env.delete(:grouping_key)
184
193
 
185
194
  configuration_custom_data = Raygun.configuration.custom_data
@@ -189,6 +198,8 @@ module Raygun
189
198
  configuration_custom_data
190
199
  end
191
200
 
201
+ Raygun.log('set custom data')
202
+
192
203
  error_details = {
193
204
  machineName: hostname,
194
205
  version: version,
@@ -204,6 +215,8 @@ module Raygun
204
215
  store = ::Raygun::Breadcrumbs::Store
205
216
  error_details[:breadcrumbs] = store.stored.map(&:build_payload) if store.any?
206
217
 
218
+ Raygun.log('set details and breadcrumbs')
219
+
207
220
  error_details.merge!(groupingKey: grouping_key) if grouping_key
208
221
 
209
222
  user_details = if affected_user_present?(env)
@@ -213,7 +226,10 @@ module Raygun
213
226
  end
214
227
  error_details.merge!(user: user_details) unless user_details == nil
215
228
 
229
+ Raygun.log('set user details')
230
+
216
231
  if Raygun.configuration.filter_payload_with_whitelist
232
+ Raygun.log('filtering payload with whitelist')
217
233
  error_details = filter_payload_with_whitelist(error_details)
218
234
  end
219
235
 
@@ -224,6 +240,8 @@ module Raygun
224
240
  end
225
241
 
226
242
  def create_entry(payload_hash)
243
+ Raygun.log('sending payload to api')
244
+
227
245
  self.class.post("/entries", verify_peer: true, verify: true, headers: @headers, body: JSON.generate(payload_hash))
228
246
  end
229
247
 
@@ -1,3 +1,3 @@
1
1
  module Raygun
2
- VERSION = "2.5.0"
2
+ VERSION = "2.6.0"
3
3
  end
data/lib/raygun.rb CHANGED
@@ -32,7 +32,6 @@ module Raygun
32
32
  CLIENT_NAME = "Raygun4Ruby Gem"
33
33
 
34
34
  class << self
35
-
36
35
  include Testable
37
36
 
38
37
  # Configuration Object (instance of Raygun::Configuration)
@@ -40,6 +39,8 @@ module Raygun
40
39
 
41
40
  def setup
42
41
  yield(configuration)
42
+
43
+ log("configuration settings: #{configuration.inspect}")
43
44
  end
44
45
 
45
46
  def configuration
@@ -55,6 +56,8 @@ module Raygun
55
56
  end
56
57
 
57
58
  def track_exception(exception_instance, env = {}, user = nil, retry_count = 1)
59
+ log('tracking exception')
60
+
58
61
  if configuration.send_in_background
59
62
  track_exception_async(exception_instance, env, user, retry_count)
60
63
  else
@@ -78,6 +81,8 @@ module Raygun
78
81
  method_name: nil,
79
82
  line_number: nil
80
83
  )
84
+ log('recording breadcrumb')
85
+
81
86
  Raygun::Breadcrumbs::Store.record(
82
87
  message: message,
83
88
  category: category,
@@ -91,7 +96,9 @@ module Raygun
91
96
  end
92
97
 
93
98
  def log(message)
94
- configuration.logger.info(message) if configuration.logger
99
+ return unless configuration.debug
100
+
101
+ configuration.logger.info("[Raygun] #{message}") if configuration.logger
95
102
  end
96
103
 
97
104
  def failsafe_log(message)
@@ -112,17 +119,19 @@ module Raygun
112
119
  future = Concurrent::Future.execute { track_exception_sync(*args) }
113
120
  future.add_observer(lambda do |_, value, reason|
114
121
  if value == nil || value.response.code != "202"
115
- log("[Raygun] unexpected response from Raygun, could indicate error: #{value.inspect}")
122
+ log("unexpected response from Raygun, could indicate error: #{value.inspect}")
116
123
  end
117
124
  end, :call)
118
125
  end
119
126
 
120
127
  def track_exception_sync(exception_instance, env, user, retry_count)
121
128
  if should_report?(exception_instance)
122
- log("[Raygun] Tracking Exception...")
129
+ log('attempting to send exception')
123
130
  Client.new.track_exception(exception_instance, env, user)
124
131
  end
125
132
  rescue Exception => e
133
+ log('error sending exception to raygun, see failsafe logger for more information')
134
+
126
135
  if configuration.failsafe_logger
127
136
  failsafe_log("Problem reporting exception to Raygun: #{e.class}: #{e.message}\n\n#{e.backtrace.join("\n")}")
128
137
  end
@@ -147,17 +156,13 @@ module Raygun
147
156
 
148
157
  def should_report?(exception)
149
158
  if configuration.silence_reporting
150
- if configuration.debug
151
- log('[Raygun] skipping reporting because Configuration.silence_reporting is enabled')
152
- end
159
+ log('skipping reporting because Configuration.silence_reporting is enabled')
153
160
 
154
161
  return false
155
162
  end
156
163
 
157
164
  if configuration.ignore.flatten.include?(exception.class.to_s)
158
- if configuration.debug
159
- log("[Raygun] skipping reporting of exception #{exception.class} because it is in the ignore list")
160
- end
165
+ log("skipping reporting of exception #{exception.class} because it is in the ignore list")
161
166
 
162
167
  return false
163
168
  end
data/lib/raygun4ruby.rb CHANGED
@@ -1 +1 @@
1
- require "raygun"
1
+ require "raygun"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raygun4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindscape
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-03 00:00:00.000000000 Z
12
+ date: 2017-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty