Class: Truemail::Logger
- Inherits:
-
Object
- Object
- Truemail::Logger
- Defined in:
- lib/truemail/logger.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(event, error_stdout, log_absolute_path) ⇒ Logger
constructor
A new instance of Logger.
- #push(validator_instance) ⇒ Object
Constructor Details
#initialize(event, error_stdout, log_absolute_path) ⇒ Logger
Returns a new instance of Logger.
9 10 11 12 13 |
# File 'lib/truemail/logger.rb', line 9 def initialize(event, error_stdout, log_absolute_path) @event = event @stdout = error_stdout @file = log_absolute_path end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
7 8 9 |
# File 'lib/truemail/logger.rb', line 7 def event @event end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/truemail/logger.rb', line 7 def file @file end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
7 8 9 |
# File 'lib/truemail/logger.rb', line 7 def stdout @stdout end |
Instance Method Details
#push(validator_instance) ⇒ Object
15 16 17 18 19 |
# File 'lib/truemail/logger.rb', line 15 def push(validator_instance) current_event = Truemail::Log::Event.new(event, validator_instance) return unless current_event.valid? create_logs(current_event.log_level, Truemail::Log::Serializer::Text.call(validator_instance)) end |