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

Less verbose mail logging: just recipients for :info log level; the whole email for :debug only. Closes #8000.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8781 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2008-02-02 05:32:15 +00:00
parent 5bbc461fcb
commit fbd3eb7142
3 changed files with 8 additions and 2 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Less verbose mail logging: just recipients for :info log level; the whole email for :debug only. #8000 [iaddict, Tarmo Tänav]
* Updated TMail to version 1.2.1 [raasdnil]
* Fixed that you don't have to call super in ActionMailer::TestCase#setup #10406 [jamesgolick]

View file

@ -468,7 +468,10 @@ module ActionMailer #:nodoc:
# no alternate has been given as the parameter, this will fail.
def deliver!(mail = @mail)
raise "no mail object available for delivery!" unless mail
logger.info "Sent mail:\n #{mail.encoded}" unless logger.nil?
unless logger.nil?
logger.info "Sent mail to #{recipients.to_a.join(', ')}"
logger.debug "\n#{mail.encoded}"
end
begin
__send__("perform_delivery_#{delivery_method}", mail) if perform_deliveries

View file

@ -534,7 +534,8 @@ class ActionMailerTest < Test::Unit::TestCase
def test_delivery_logs_sent_mail
mail = TestMailer.create_signed_up(@recipient)
logger = mock()
logger.expects(:info).with("Sent mail:\n #{mail.encoded}")
logger.expects(:info).with("Sent mail to #{@recipient}")
logger.expects(:debug).with("\n#{mail.encoded}")
TestMailer.logger = logger
TestMailer.deliver_signed_up(@recipient)
end