Class: Thrifty::Logger::Entry

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#levelObject

Returns the value of attribute level

Returns:

  • (Object)

    the current value of level



2
3
4
# File 'lib/thrifty/logger/entry.rb', line 2

def level
  @level
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



2
3
4
# File 'lib/thrifty/logger/entry.rb', line 2

def message
  @message
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



2
3
4
# File 'lib/thrifty/logger/entry.rb', line 2

def payload
  @payload
end

#scopeObject

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



2
3
4
# File 'lib/thrifty/logger/entry.rb', line 2

def scope
  @scope
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



2
3
4
# File 'lib/thrifty/logger/entry.rb', line 2

def time
  @time
end

Instance Method Details

#to_hObject



3
4
5
6
7
8
9
10
# File 'lib/thrifty/logger/entry.rb', line 3

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