You should use a registrar instead puts. Use the following statements:
Rails.logger.debug "DEBUG: #{self.inspect} #{caller(0).first}" if Rails.logger.debug?
If you want to see real-time debugging (almost), just use the command tailin another terminal window:
tail -F log/development.log | grep DEBUG
, , if logger.debug? (, ) .
. , , STDERR, :
STDERR.puts "DEBUG: xyzzy"
Rails (, ) logger, , , Rails.logger.
Rails, RAILS_DEFAULT_LOGGER Rails.logger.