Class: Thrifty::Logger::ExceptionEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/thrifty/logger/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exceptionObject

Returns the value of attribute exception

Returns:

  • (Object)

    the current value of exception



13
14
15
# File 'lib/thrifty/logger/entry.rb', line 13

def exception
  @exception
end

#levelObject

Returns the value of attribute level

Returns:

  • (Object)

    the current value of level



13
14
15
# File 'lib/thrifty/logger/entry.rb', line 13

def level
  @level
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



13
14
15
# File 'lib/thrifty/logger/entry.rb', line 13

def payload
  @payload
end

#scopeObject

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



13
14
15
# File 'lib/thrifty/logger/entry.rb', line 13

def scope
  @scope
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



13
14
15
# File 'lib/thrifty/logger/entry.rb', line 13

def time
  @time
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
21
22
# File 'lib/thrifty/logger/entry.rb', line 14

def to_h
  {
    level:     level || :error,
    time:      time  || Time.now,
    message:   exception.message,
    scope:     scope,
    exception: exception.class.to_s,
  }.merge!(payload || {})
end