Posted By

insanedreamer on 07/06/10


Tagged

textmate rails ruby logging


Versions (?)

easy-to-find logger.info output (rails)


 / Published in: Rails
 

  1. def log(*entries)
  2. # makes it easy to find logger output in your log files
  3. logger.info "e[1;32m LOGGER OUTPUT: #{Time.now} e[0m"
  4. entries.each { |e| logger.info "e[1;31m #{e}e[0m" }
  5. logger.info "e[1;32m --- END --- e[0m"
  6. end

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: insanedreamer on July 10, 2010

You can use this in test_helper for tests as well. Replace logger.info with Rails.logger.info.

You need to login to post a comment.