Class: DataChecks::Notifiers::LoggerNotifier
- Defined in:
- lib/data_checks/notifiers/logger_notifier.rb
Instance Attribute Summary
Attributes inherited from Notifier
Instance Method Summary collapse
-
#initialize(options) ⇒ LoggerNotifier
constructor
A new instance of LoggerNotifier.
- #notify(check_result) ⇒ Object
Constructor Details
#initialize(options) ⇒ LoggerNotifier
Returns a new instance of LoggerNotifier.
8 9 10 11 12 13 14 15 |
# File 'lib/data_checks/notifiers/logger_notifier.rb', line 8 def initialize() super logdev = [:logdev] || $stdout level = [:level] || Logger::INFO @logger = ActiveSupport::Logger.new(logdev, level: level) @formatter_class = .delete(:formatter_class) || LoggerDefaultFormatter end |
Instance Method Details
#notify(check_result) ⇒ Object
17 18 19 20 |
# File 'lib/data_checks/notifiers/logger_notifier.rb', line 17 def notify(check_result) formatter = @formatter_class.new(check_result) @logger.add(@logger.level, formatter.) end |