1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix ActionMailer::LogSubscriber to use the correct log level check.

This commit is contained in:
Brian Durand 2012-09-19 16:46:48 -07:00
parent 19f0e37d7a
commit d47fde6dcb

View file

@ -1,14 +1,14 @@
module ActionMailer module ActionMailer
class LogSubscriber < ActiveSupport::LogSubscriber class LogSubscriber < ActiveSupport::LogSubscriber
def deliver(event) def deliver(event)
return unless logger.debug? return unless logger.info?
recipients = Array(event.payload[:to]).join(', ') recipients = Array(event.payload[:to]).join(', ')
info("\nSent mail to #{recipients} (#{event.duration.round(1)}ms)") info("\nSent mail to #{recipients} (#{event.duration.round(1)}ms)")
debug(event.payload[:mail]) debug(event.payload[:mail])
end end
def receive(event) def receive(event)
return unless logger.debug? return unless logger.info?
info("\nReceived mail (#{event.duration.round(1)}ms)") info("\nReceived mail (#{event.duration.round(1)}ms)")
debug(event.payload[:mail]) debug(event.payload[:mail])
end end