Class: Sentry::CustomStacktraceFrame

Inherits:
Interface
  • Object
show all
Defined in:
lib/fluent/plugin/out_sentry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename:, context_line:, pre_context: '', post_context: '', lineno: 1) ⇒ CustomStacktraceFrame

Returns a new instance of CustomStacktraceFrame.



144
145
146
147
148
149
150
# File 'lib/fluent/plugin/out_sentry.rb', line 144

def initialize(filename:, context_line:, pre_context: '', post_context: '', lineno: 1)
  @filename = filename
  @context_line = context_line
  @pre_context = pre_context.split("\n")
  @post_context = post_context.split("\n")
  @lineno = lineno
end

Instance Attribute Details

#context_lineObject

Returns the value of attribute context_line.



142
143
144
# File 'lib/fluent/plugin/out_sentry.rb', line 142

def context_line
  @context_line
end

#filenameObject

Returns the value of attribute filename.



142
143
144
# File 'lib/fluent/plugin/out_sentry.rb', line 142

def filename
  @filename
end

#linenoObject

Returns the value of attribute lineno.



142
143
144
# File 'lib/fluent/plugin/out_sentry.rb', line 142

def lineno
  @lineno
end

#post_contextObject

Returns the value of attribute post_context.



142
143
144
# File 'lib/fluent/plugin/out_sentry.rb', line 142

def post_context
  @post_context
end

#pre_contextObject

Returns the value of attribute pre_context.



142
143
144
# File 'lib/fluent/plugin/out_sentry.rb', line 142

def pre_context
  @pre_context
end

Instance Method Details

#to_hash(*args) ⇒ Object



152
153
154
155
156
157
158
# File 'lib/fluent/plugin/out_sentry.rb', line 152

def to_hash(*args)
  data = super(*args)
  data.delete(:pre_context) unless pre_context && !pre_context.empty?
  data.delete(:post_context) unless post_context && !post_context.empty?
  data.delete(:context_line) unless context_line && !context_line.empty?
  data
end