Class: Sentry::Breadcrumb

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry/breadcrumb.rb,
lib/sentry/breadcrumb/sentry_logger.rb

Defined Under Namespace

Modules: SentryLogger

Constant Summary collapse

MAX_NESTING =
10
DATA_SERIALIZATION_ERROR_MESSAGE =
"[data were removed due to serialization issues]"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(category: nil, data: nil, message: nil, timestamp: nil, level: nil, type: nil) ⇒ Breadcrumb



27
28
29
30
31
32
33
34
# File 'lib/sentry/breadcrumb.rb', line 27

def initialize(category: nil, data: nil, message: nil, timestamp: nil, level: nil, type: nil)
  @category = category
  @data = data || {}
  @timestamp = timestamp || Sentry.utc_now.to_i
  @type = type
  self.message = message
  self.level = level
end

Instance Attribute Details

#categoryString?



9
10
11
# File 'lib/sentry/breadcrumb.rb', line 9

def category
  @category
end

#dataHash?



11
12
13
# File 'lib/sentry/breadcrumb.rb', line 11

def data
  @data
end

#levelString?



13
14
15
# File 'lib/sentry/breadcrumb.rb', line 13

def level
  @level
end

#messageString?



19
20
21
# File 'lib/sentry/breadcrumb.rb', line 19

def message
  @message
end

#timestampTime, ...



15
16
17
# File 'lib/sentry/breadcrumb.rb', line 15

def timestamp
  @timestamp
end

#typeString?



17
18
19
# File 'lib/sentry/breadcrumb.rb', line 17

def type
  @type
end

Instance Method Details

#to_hHash



37
38
39
40
41
42
43
44
45
46
# File 'lib/sentry/breadcrumb.rb', line 37

def to_h
  {
    category: @category,
    data: serialized_data,
    level: @level,
    message: @message,
    timestamp: @timestamp,
    type: @type
  }
end