Sha256: e4dcd0b21638f06cbbbed1bff23fec50b90f92f09057faf9a1d2a67759f37301

Contents?: true

Size: 546 Bytes

Versions: 3

Compression:

Stored size: 546 Bytes

Contents

require 'active_support/core_ext/array/wrap'

module ActionMailer
  module Railties
    class LogSubscriber < Rails::LogSubscriber
      def deliver(event)
        recipients = Array.wrap(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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
actionmailer-3.0.0.beta4 lib/action_mailer/railties/log_subscriber.rb
actionmailer-3.0.0.beta3 lib/action_mailer/railties/log_subscriber.rb
actionmailer-3.0.0.beta2 lib/action_mailer/railties/log_subscriber.rb