Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8781

Show
Ignore:
Timestamp:
02/02/08 05:32:15 (7 months ago)
Author:
bitsweat
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionmailer/CHANGELOG

    r8622 r8781  
    11*SVN* 
     2 
     3* Less verbose mail logging: just recipients for :info log level; the whole email for :debug only.  #8000 [iaddict, Tarmo TÀnav] 
    24 
    35* Updated TMail to version 1.2.1 [raasdnil] 
  • trunk/actionmailer/lib/action_mailer/base.rb

    r8683 r8781  
    469469    def deliver!(mail = @mail) 
    470470      raise "no mail object available for delivery!" unless mail 
    471       logger.info "Sent mail:\n #{mail.encoded}" unless logger.nil? 
     471      unless logger.nil? 
     472        logger.info  "Sent mail to #{recipients.to_a.join(', ')}" 
     473        logger.debug "\n#{mail.encoded}" 
     474      end 
    472475 
    473476      begin 
  • trunk/actionmailer/test/mail_service_test.rb

    r8620 r8781  
    535535    mail = TestMailer.create_signed_up(@recipient) 
    536536    logger = mock() 
    537     logger.expects(:info).with("Sent mail:\n #{mail.encoded}") 
     537    logger.expects(:info).with("Sent mail to #{@recipient}") 
     538    logger.expects(:debug).with("\n#{mail.encoded}") 
    538539    TestMailer.logger = logger 
    539540    TestMailer.deliver_signed_up(@recipient)