class Sentry::Breadcrumb

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/sentry/breadcrumb.rbs

class Sentry::Breadcrumb
  def initialize: (category: String, data: Hash?, message: String?, timestamp: Integer?, level: String?, type: String?) -> void
  def message=: (nil message) -> String
end

def initialize(category: nil, data: nil, message: nil, timestamp: nil, level: nil, type: nil)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (category: String, data: (sql | String | name | String | statement_name | NilClass | nil | record_count | Integer | class_name | String), message: String?, timestamp: Integer?, level: String?, type: String?) -> void

This signature was generated using 5 samples from 1 application.

Parameters:
  • type (String, nil) --
  • level (String, nil) --
  • timestamp (Time, Integer, nil) --
  • message (String, nil) --
  • data (Hash, nil) --
  • category (String, nil) --
def initialize(category: nil, data: nil, message: nil, timestamp: nil, level: nil, type: nil)
  @category = category
  @data = data || {}
  @level = level
  @timestamp = timestamp || Sentry.utc_now.to_i
  @type = type
  self.message = message
end

def message=(message)

Experimental RBS support (using type sampling data from the type_fusion project).

def message=: (nil message) -> String

This signature was generated using 2 samples from 1 application.

Returns:
  • (void) -

Parameters:
  • message (String) --
def message=(message)
  @message = (message || "").byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES)
end

def serialized_data

def serialized_data
  begin
    ::JSON.parse(::JSON.generate(@data))
  rescue Exception => e
    Sentry.logger.debug(LOGGER_PROGNAME) do
      <<~MSG
t serialize breadcrumb data because of error: #{e}
: #{@data}
      MSG
    end
    DATA_SERIALIZATION_ERROR_MESSAGE
  end
end

def to_hash

Returns:
  • (Hash) -
def to_hash
  {
    category: @category,
    data: serialized_data,
    level: @level,
    message: @message,
    timestamp: @timestamp,
    type: @type
  }
end