Class: Sentry::Breadcrumb

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

Defined Under Namespace

Modules: SentryLogger

Constant Summary collapse

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

Returns a new instance of Breadcrumb.



7
8
9
10
11
12
13
14
# File 'lib/sentry/breadcrumb.rb', line 7

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

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



5
6
7
# File 'lib/sentry/breadcrumb.rb', line 5

def category
  @category
end

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/sentry/breadcrumb.rb', line 5

def data
  @data
end

#levelObject

Returns the value of attribute level.



5
6
7
# File 'lib/sentry/breadcrumb.rb', line 5

def level
  @level
end

#messageObject

Returns the value of attribute message.



5
6
7
# File 'lib/sentry/breadcrumb.rb', line 5

def message
  @message
end

#timestampObject

Returns the value of attribute timestamp.



5
6
7
# File 'lib/sentry/breadcrumb.rb', line 5

def timestamp
  @timestamp
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/sentry/breadcrumb.rb', line 5

def type
  @type
end

Instance Method Details

#to_hashObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/sentry/breadcrumb.rb', line 16

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