Sha256: e91d4b1d2bf5b0b837cd4cca3a3be12b573f337dafb838a8c11a84e1c023c9c8

Contents?: true

Size: 555 Bytes

Versions: 184

Compression:

Stored size: 555 Bytes

Contents

require 'active_support/core_ext/array/wrap'

module ActionMailer
  class LogSubscriber < ActiveSupport::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

ActionMailer::LogSubscriber.attach_to :action_mailer

Version data entries

184 entries across 158 versions & 11 rubygems

Version Path
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/log_subscriber.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/actionmailer-3.2.12/lib/action_mailer/log_subscriber.rb
actionmailer-3.2.15.rc3 lib/action_mailer/log_subscriber.rb
actionmailer-3.2.15.rc2 lib/action_mailer/log_subscriber.rb
actionmailer-3.2.15.rc1 lib/action_mailer/log_subscriber.rb
actionmailer-3.2.14 lib/action_mailer/log_subscriber.rb
actionmailer-3.2.14.rc2 lib/action_mailer/log_subscriber.rb
actionmailer-3.2.14.rc1 lib/action_mailer/log_subscriber.rb
swipe-rails-0.0.5 vendor/bundle/gems/actionmailer-3.2.13/lib/action_mailer/log_subscriber.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/log_subscriber.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/log_subscriber.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/log_subscriber.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/log_subscriber.rb
challah-1.0.0.beta3 vendor/bundle/gems/actionmailer-3.2.13/lib/action_mailer/log_subscriber.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.13/lib/action_mailer/log_subscriber.rb
challah-1.0.0.beta2 vendor/bundle/gems/actionmailer-3.2.13/lib/action_mailer/log_subscriber.rb
challah-1.0.0.beta vendor/bundle/gems/actionmailer-3.2.13/lib/action_mailer/log_subscriber.rb
challah-1.0.0.beta vendor/bundle/gems/actionmailer-3.2.11/lib/action_mailer/log_subscriber.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.13/lib/action_mailer/log_subscriber.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.13/lib/action_mailer/log_subscriber.rb