Class: LogEasy::Log
- Inherits:
-
Object
- Object
- LogEasy::Log
- Defined in:
- lib/logeasy/log.rb
Overview
Represents the actual log message. Simply a wrapper for the log information (i.e. level, logger, timestamp, message, etc…).
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#message ⇒ Object
Returns the value of attribute message.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#unformatted ⇒ Object
Returns the value of attribute unformatted.
Instance Method Summary collapse
-
#initialize(logger, level, message, unformatted = false) ⇒ Log
constructor
New log item.
Constructor Details
#initialize(logger, level, message, unformatted = false) ⇒ Log
New log item.
‘logger’ - The logger that received this log message. ‘level’ - The severity of this log. ‘message’ - The message to log. ‘unformatted’ - Optional. Default is false, but if set to true, this log item will not be formatted.
23 24 25 26 27 28 29 |
# File 'lib/logeasy/log.rb', line 23 def initialize(logger, level, , unformatted = false) @logger = logger @level = level @message = @timestamp = Time.now @unformatted = unformatted end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
12 13 14 |
# File 'lib/logeasy/log.rb', line 12 def level @level end |
#logger ⇒ Object
Returns the value of attribute logger.
11 12 13 |
# File 'lib/logeasy/log.rb', line 11 def logger @logger end |
#message ⇒ Object
Returns the value of attribute message.
13 14 15 |
# File 'lib/logeasy/log.rb', line 13 def @message end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
14 15 16 |
# File 'lib/logeasy/log.rb', line 14 def @timestamp end |
#unformatted ⇒ Object
Returns the value of attribute unformatted.
15 16 17 |
# File 'lib/logeasy/log.rb', line 15 def unformatted @unformatted end |