class RfLogger::ErrorNotification
Public Class Methods
add_notifier(notifier, constraints={})
click to toggle source
# File lib/rf_logger/notifications/error_notification.rb, line 14 def add_notifier notifier, constraints={} levels = constraints.delete(:levels) || RfLogger::LEVELS constraint = ErrorNotification::EnvironmentConstraints.new( RfLogger.configuration.environment, constraints) if constraint.valid_notifier? levels.each do |level| notifiers[level] << notifier end end end
configure() { |self| ... }
click to toggle source
# File lib/rf_logger/notifications/error_notification.rb, line 6 def configure(&block) yield self end
dispatch_error(log_info)
click to toggle source
# File lib/rf_logger/notifications/error_notification.rb, line 26 def dispatch_error(log_info) notifiers[log_info.level.to_sym].each do |notifier| notifier.send_notification log_info end end
notifiers()
click to toggle source
# File lib/rf_logger/notifications/error_notification.rb, line 10 def notifiers @notifiers ||= Hash[RfLogger::LEVELS.map { |level| [level, []] }] end
reset!()
click to toggle source
# File lib/rf_logger/notifications/error_notification.rb, line 32 def reset! @notifiers = nil; notifiers end