From f0523f72b46db14e2f50c8347a8708734c650f84 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Mon, 15 Feb 2010 21:44:30 +0700 Subject: Rename Rails::Subscriber to Rails::LogSubscriber --- .../lib/action_mailer/railties/log_subscriber.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 actionmailer/lib/action_mailer/railties/log_subscriber.rb (limited to 'actionmailer/lib/action_mailer/railties/log_subscriber.rb') diff --git a/actionmailer/lib/action_mailer/railties/log_subscriber.rb b/actionmailer/lib/action_mailer/railties/log_subscriber.rb new file mode 100644 index 0000000000..d1b3dd33af --- /dev/null +++ b/actionmailer/lib/action_mailer/railties/log_subscriber.rb @@ -0,0 +1,20 @@ +module ActionMailer + module Railties + class LogSubscriber < Rails::LogSubscriber + def deliver(event) + recipients = Array(event.payload[:to]).join(', ') + info("\nSent mail to #{recipients} (%1.fms)" % event.duration) + debug(event.payload[:mail]) + end + + def receive(event) + info("\nReceived mail (%.1fms)" % event.duration) + debug(event.payload[:mail]) + end + + def logger + ActionMailer::Base.logger + end + end + end +end \ No newline at end of file -- cgit v1.2.3