Class: Resque::Plugins::AlarmNotifier::LogNotifier
- Inherits:
-
Object
- Object
- Resque::Plugins::AlarmNotifier::LogNotifier
- Defined in:
- lib/resque/plugins/alarm_notifier/log_notifier.rb
Instance Method Summary collapse
-
#initialize(logger = nil, level = :info, app_name = "app") ⇒ LogNotifier
constructor
A new instance of LogNotifier.
- #notify(params) ⇒ Object
Constructor Details
#initialize(logger = nil, level = :info, app_name = "app") ⇒ LogNotifier
Returns a new instance of LogNotifier.
5 6 7 8 9 |
# File 'lib/resque/plugins/alarm_notifier/log_notifier.rb', line 5 def initialize(logger = nil, level = :info, app_name = "app") @logger = logger @level = level.to_sym @app_name = app_name end |
Instance Method Details
#notify(params) ⇒ Object
10 11 12 13 |
# File 'lib/resque/plugins/alarm_notifier/log_notifier.rb', line 10 def notify(params) return unless @logger.respond_to?(@level) @logger.send(@level, format(params)) end |