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.



116
117
118
119
120
121
122
# File 'lib/fluent/plugin/out_sentry.rb', line 116

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.



114
115
116
# File 'lib/fluent/plugin/out_sentry.rb', line 114

def context_line
  @context_line
end

#filenameObject

Returns the value of attribute filename.



114
115
116
# File 'lib/fluent/plugin/out_sentry.rb', line 114

def filename
  @filename
end

#linenoObject

Returns the value of attribute lineno.



114
115
116
# File 'lib/fluent/plugin/out_sentry.rb', line 114

def lineno
  @lineno
end

#post_contextObject

Returns the value of attribute post_context.



114
115
116
# File 'lib/fluent/plugin/out_sentry.rb', line 114

def post_context
  @post_context
end

#pre_contextObject

Returns the value of attribute pre_context.



114
115
116
# File 'lib/fluent/plugin/out_sentry.rb', line 114

def pre_context
  @pre_context
end

Instance Method Details

#to_hash(*args) ⇒ Object



124
125
126
127
128
129
130
# File 'lib/fluent/plugin/out_sentry.rb', line 124

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