Class: Henry::Logger
- Inherits:
-
Object
- Object
- Henry::Logger
- Defined in:
- lib/henry/logger.rb
Overview
Henry Logger Grants the ability log messages under several levels during execution time
Instance Attribute Summary collapse
-
#storage(level) ⇒ Array
Returns the storage of the given level.
Instance Method Summary collapse
-
#error(message) ⇒ Object
Appends the message as a log entry under the error level.
-
#get_storage ⇒ Hash
Returns the storage.
-
#info(message) ⇒ Object
Appends the message as a log entry under the info level.
-
#log_as_hash ⇒ Object
Return the stored logs.
-
#warn(message) ⇒ Object
Appends the message as a log entry under the warm level.
Instance Attribute Details
#storage(level) ⇒ Array
Returns the storage of the given level
46 47 48 |
# File 'lib/henry/logger.rb', line 46 def storage @storage end |
Instance Method Details
#error(message) ⇒ Object
Appends the message as a log entry under the error level.
26 27 28 |
# File 'lib/henry/logger.rb', line 26 def error() self.log(:error, ) end |
#get_storage ⇒ Hash
Returns the storage
38 39 40 |
# File 'lib/henry/logger.rb', line 38 def get_storage @storage ||= {} end |
#info(message) ⇒ Object
Appends the message as a log entry under the info level.
12 13 14 |
# File 'lib/henry/logger.rb', line 12 def info() self.log(:info, ) end |
#log_as_hash ⇒ Object
Return the stored logs.
31 32 33 |
# File 'lib/henry/logger.rb', line 31 def log_as_hash self.get_storage end |
#warn(message) ⇒ Object
Appends the message as a log entry under the warm level.
19 20 21 |
# File 'lib/henry/logger.rb', line 19 def warn() self.log(:warn, ) end |