Class: Truemail::Logger
- Inherits:
-
Object
- Object
- Truemail::Logger
- Defined in:
- lib/truemail/logger.rb
Defined Under Namespace
Classes: Builder
Constant Summary collapse
- BUILDER_ATTRS =
%i[tracking_event stdout log_absolute_path custom_logger].freeze
Instance Attribute Summary collapse
-
#custom_logger ⇒ Object
readonly
Returns the value of attribute custom_logger.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#file_logger ⇒ Object
readonly
Returns the value of attribute file_logger.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
-
#stdout_logger ⇒ Object
readonly
Returns the value of attribute stdout_logger.
Instance Method Summary collapse
-
#initialize(event, error_stdout, log_absolute_path, custom_logger) ⇒ Logger
constructor
A new instance of Logger.
- #push(validator_instance) ⇒ Object
Constructor Details
#initialize(event, error_stdout, log_absolute_path, custom_logger) ⇒ Logger
Returns a new instance of Logger.
60 61 62 63 64 65 66 |
# File 'lib/truemail/logger.rb', line 60 def initialize(event, error_stdout, log_absolute_path, custom_logger) @event = event @stdout = error_stdout @file = log_absolute_path @custom_logger = custom_logger init_builtin_loggers end |
Instance Attribute Details
#custom_logger ⇒ Object (readonly)
Returns the value of attribute custom_logger.
58 59 60 |
# File 'lib/truemail/logger.rb', line 58 def custom_logger @custom_logger end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
58 59 60 |
# File 'lib/truemail/logger.rb', line 58 def event @event end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
58 59 60 |
# File 'lib/truemail/logger.rb', line 58 def file @file end |
#file_logger ⇒ Object (readonly)
Returns the value of attribute file_logger.
58 59 60 |
# File 'lib/truemail/logger.rb', line 58 def file_logger @file_logger end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
58 59 60 |
# File 'lib/truemail/logger.rb', line 58 def stdout @stdout end |
#stdout_logger ⇒ Object (readonly)
Returns the value of attribute stdout_logger.
58 59 60 |
# File 'lib/truemail/logger.rb', line 58 def stdout_logger @stdout_logger end |
Instance Method Details
#push(validator_instance) ⇒ Object
68 69 70 71 72 |
# File 'lib/truemail/logger.rb', line 68 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::ValidatorText.call(validator_instance)) end |