Class: ActionMailer::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber show all
Defined in:
actionmailer/lib/action_mailer/log_subscriber.rb

Constant Summary

Constants inherited from ActiveSupport::LogSubscriber

ActiveSupport::LogSubscriber::BLACK, ActiveSupport::LogSubscriber::BLUE, ActiveSupport::LogSubscriber::BOLD, ActiveSupport::LogSubscriber::CLEAR, ActiveSupport::LogSubscriber::CYAN, ActiveSupport::LogSubscriber::GREEN, ActiveSupport::LogSubscriber::MAGENTA, ActiveSupport::LogSubscriber::RED, ActiveSupport::LogSubscriber::WHITE, ActiveSupport::LogSubscriber::YELLOW

Instance Method Summary collapse

Methods inherited from ActiveSupport::LogSubscriber

attach_to, #call, flush_all!, flushable_loggers, log_subscribers, logger

Instance Method Details

#deliver(event) ⇒ Object



5
6
7
8
9
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 5

def deliver(event)
  recipients = Array.wrap(event.payload[:to]).join(', ')
  info("\nSent mail to #{recipients} (%1.fms)" % event.duration)
  debug(event.payload[:mail])
end

#loggerObject



16
17
18
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 16

def logger
  ActionMailer::Base.logger
end

#receive(event) ⇒ Object



11
12
13
14
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 11

def receive(event)
  info("\nReceived mail (%.1fms)" % event.duration)
  debug(event.payload[:mail])
end