logstasher 2.1.2 → 2.1.3

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
  SHA256:
3
- metadata.gz: 33158a121af27be0e9bd17ac2c3e9ac3e40823a52db857ad9954d370d339eb63
4
- data.tar.gz: cf62d43543a0b3b6948c1c29233c5eedfd21188f9f0cb6f98fdf9276f933b54f
3
+ metadata.gz: 59cdc11b4f36e90443fcc8ea7332552874da2ad2205f38e4efac48c8e4dda63a
4
+ data.tar.gz: 997cb22cb6799f67d28562e986e326fa23597ee5168a635bdc917d6a9bb65c6b
5
5
  SHA512:
6
- metadata.gz: 9f403b9a4d329f51c981ed6b57ab1ff2e6ef4ecc58f0943c59eb6d136b9cbdda39d8a904f02511258972fb99597a66ff75a8f53ac17906e837867400a83d66d7
7
- data.tar.gz: 57e572d794e472c73496f163023b3f61379998d0e80a4e9cc73d7c37fbbbf2a1999dd53697b897e0a8034d6362184cd86020162409406ecfd68716014bda9bf0
6
+ metadata.gz: dd6d94a4055566fd119a570107724ce1fc1c1f3f1781f2929c248e4f2b227a3f95adb010b6e059f44cf49991f5baa1d9f3271f272efb5a97415104a265eb0e1b
7
+ data.tar.gz: 35d3e80b5e460753033b327e41d51149d24b20c7b1321189a2ec24373ac5aa9c713189eba701ddc3ec5904fbf86a2b98657deff4c2a02fcfcee20f93c31fd9f9
@@ -20,7 +20,7 @@ module LogStasher
20
20
  REQUEST_CONTEXT_KEY = :logstasher_request_context
21
21
 
22
22
  attr_accessor :logger, :logger_path, :enabled, :log_controller_parameters, :source, :backtrace,
23
- :controller_monkey_patch, :field_renaming
23
+ :controller_monkey_patch, :field_renaming, :backtrace_filter
24
24
 
25
25
  # Setting the default to 'unknown' to define the default behaviour
26
26
  @source = 'unknown'
@@ -113,6 +113,7 @@ module LogStasher
113
113
  self.source = config.source unless config.source.nil?
114
114
  self.log_controller_parameters = !config.log_controller_parameters.nil?
115
115
  self.backtrace = !config.backtrace.nil? unless config.backtrace.nil?
116
+ self.backtrace_filter = config.backtrace_filter
116
117
  set_data_for_rake
117
118
  set_data_for_console
118
119
  self.field_renaming = Hash(config.field_renaming)
@@ -86,10 +86,14 @@ module LogStasher
86
86
  exception, message = payload[:exception]
87
87
  status = ::ActionDispatch::ExceptionWrapper.status_code_for_exception(exception)
88
88
  backtrace = if LogStasher.backtrace
89
- $!.backtrace.join("\n")
90
- else
91
- $!.backtrace.first
92
- end
89
+ if LogStasher.backtrace_filter.respond_to?(:call)
90
+ LogStasher.backtrace_filter.call($!.backtrace).join("\n")
91
+ else
92
+ $!.backtrace.join("\n")
93
+ end
94
+ else
95
+ $!.backtrace.first
96
+ end
93
97
  message = "#{exception}\n#{message}\n#{backtrace}"
94
98
  { status: status, error: message }
95
99
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogStasher
4
- VERSION = '2.1.2'
4
+ VERSION = '2.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstasher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shadab Ahmed