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.



120
121
122
123
124
125
126
# File 'lib/fluent/plugin/out_sentry.rb', line 120

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.



118
119
120
# File 'lib/fluent/plugin/out_sentry.rb', line 118

def context_line
  @context_line
end

#filenameObject

Returns the value of attribute filename.



118
119
120
# File 'lib/fluent/plugin/out_sentry.rb', line 118

def filename
  @filename
end

#linenoObject

Returns the value of attribute lineno.



118
119
120
# File 'lib/fluent/plugin/out_sentry.rb', line 118

def lineno
  @lineno
end

#post_contextObject

Returns the value of attribute post_context.



118
119
120
# File 'lib/fluent/plugin/out_sentry.rb', line 118

def post_context
  @post_context
end

#pre_contextObject

Returns the value of attribute pre_context.



118
119
120
# File 'lib/fluent/plugin/out_sentry.rb', line 118

def pre_context
  @pre_context
end

Instance Method Details

#to_hash(*args) ⇒ Object



128
129
130
131
132
133
134
# File 'lib/fluent/plugin/out_sentry.rb', line 128

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