diff options
Diffstat (limited to 'actionmailer/lib/action_mailer/log_subscriber.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/log_subscriber.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/log_subscriber.rb b/actionmailer/lib/action_mailer/log_subscriber.rb index a6c163832e..fe1bca969c 100644 --- a/actionmailer/lib/action_mailer/log_subscriber.rb +++ b/actionmailer/lib/action_mailer/log_subscriber.rb @@ -1,13 +1,15 @@ module ActionMailer class LogSubscriber < ActiveSupport::LogSubscriber def deliver(event) + return unless logger.debug? recipients = Array(event.payload[:to]).join(', ') - info("\nSent mail to #{recipients} (%1.fms)" % event.duration) + info("\nSent mail to #{recipients} (#{event.duration.round(1)}ms)") debug(event.payload[:mail]) end def receive(event) - info("\nReceived mail (%.1fms)" % event.duration) + return unless logger.debug? + info("\nReceived mail (#{event.duration.round(1)}ms)") debug(event.payload[:mail]) end |