Class: Recurrent::Logger
- Inherits:
-
Object
- Object
- Recurrent::Logger
- Defined in:
- lib/recurrent/logger.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identifier) ⇒ Logger
constructor
A new instance of Logger.
- #log_message(message) ⇒ Object
Constructor Details
#initialize(identifier) ⇒ Logger
Returns a new instance of Logger.
6 7 8 |
# File 'lib/recurrent/logger.rb', line 6 def initialize(identifier) @identifier = identifier end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/recurrent/logger.rb', line 4 def identifier @identifier end |
Class Method Details
.define_log_levels(*log_levels) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/recurrent/logger.rb', line 14 def self.define_log_levels(*log_levels) log_levels.each do |log_level| define_method(log_level) do || = () puts unless Configuration.logging == "quiet" Configuration.logger.call(, log_level) if Configuration.logger end end end |
Instance Method Details
#log_message(message) ⇒ Object
10 11 12 |
# File 'lib/recurrent/logger.rb', line 10 def () "[Recurrent - Process:#{@identifier} - Timestamp:#{Time.now.to_s(:seconds)}] - #{}" end |