Class: MrLogaLoga::LogMessage
- Inherits:
-
Struct
- Object
- Struct
- MrLogaLoga::LogMessage
- Defined in:
- lib/mr_loga_loga/log_message.rb
Overview
A structured log message containing the actual message and context
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#msg ⇒ Object
Returns the value of attribute msg.
Instance Method Summary collapse
-
#inspect ⇒ Object
Format the log message.
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context
7 8 9 |
# File 'lib/mr_loga_loga/log_message.rb', line 7 def context @context end |
#msg ⇒ Object
Returns the value of attribute msg
7 8 9 |
# File 'lib/mr_loga_loga/log_message.rb', line 7 def msg @msg end |
Instance Method Details
#inspect ⇒ Object
Format the log message. This is a fallback for logger exctending MrLogaLoga who do not know how to format LogMessage themselves.
10 11 12 13 |
# File 'lib/mr_loga_loga/log_message.rb', line 10 def inspect # This is identical to ActiveRecord::SimpleFormatter "#{msg.is_a?(String) ? msg : msg.inspect}\n" end |