123456789_123456789_123456789_123456789_123456789_

Class: ActionMailer::LogSubscriber

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveSupport::EventReporter::LogSubscriber
Defined in: actionmailer/lib/action_mailer/log_subscriber.rb

Constant Summary

::ActiveSupport::ColorizeLogging - Included

BLACK, BLUE, CYAN, GREEN, MAGENTA, MODES, RED, WHITE, YELLOW

::ActiveSupport::EventReporter::LogSubscriber - Inherited

LEVEL_CHECKS

Class Attribute Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::ActiveSupport::EventReporter::LogSubscriber - Inherited

::ActiveSupport::ColorizeLogging - Included

#color

Set color by using a symbol or one of the defined constants.

#colorize_logging, #debug, #error, #fatal, #info, #mode_from, #unknown, #warn

Class Method Details

.default_logger

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 36

def self.default_logger
  ActionMailer::Base.logger
end

Instance Method Details

#delivered(event)

An email was delivered.

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 10

def delivered(event)
  payload = event[:payload]
  info do
    if payload[:exception_class]
      "Failed delivery of mail #{payload[:message_id]} error_class=#{payload[:exception_class]} error_message=#{payload[:exception_message].inspect}"
    elsif payload[:perform_deliveries]
      "Delivered mail #{payload[:message_id]} (#{payload[:duration_ms].round(1)}ms)"
    else
      "Skipped delivery of mail #{payload[:message_id]} as `perform_deliveries` is false"
    end
  end

  debug { payload[:mail] }
end

#processed(event)

An email was generated.

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 27

def processed(event)
  debug do
    mailer = event[:payload][:mailer]
    action = event[:payload][:action]
    "#{mailer}##{action}: processed outbound mail in #{event[:payload][:duration_ms].round(1)}ms"
  end
end