Class: Logfoo::Entry
- Inherits:
-
Struct
- Object
- Struct
- Logfoo::Entry
- Defined in:
- lib/logfoo/entry.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#message ⇒ Object
Returns the value of attribute message.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#thread ⇒ Object
Returns the value of attribute thread.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level
2 3 4 |
# File 'lib/logfoo/entry.rb', line 2 def level @level end |
#message ⇒ Object
Returns the value of attribute message
2 3 4 |
# File 'lib/logfoo/entry.rb', line 2 def @message end |
#payload ⇒ Object
Returns the value of attribute payload
2 3 4 |
# File 'lib/logfoo/entry.rb', line 2 def payload @payload end |
#scope ⇒ Object
Returns the value of attribute scope
2 3 4 |
# File 'lib/logfoo/entry.rb', line 2 def scope @scope end |
#thread ⇒ Object
Returns the value of attribute thread
2 3 4 |
# File 'lib/logfoo/entry.rb', line 2 def thread @thread end |
#time ⇒ Object
Returns the value of attribute time
2 3 4 |
# File 'lib/logfoo/entry.rb', line 2 def time @time end |
Instance Method Details
#to_h ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/logfoo/entry.rb', line 3 def to_h { level: level || :info, time: time || Time.now, msg: , scope: scope, }.merge!( payload || {} ).merge!( thread: thread ) end |