Is there a way I can have print statements in Rails code that will go either to the WEBrick console (prefered) or to a log file?
logger.info "Some statement" You can call this from the controller, model or view. Lucas Carlson http://tech.rufy.com/ On Jul 7, 2005, at 3:43 PM, Steve Downey wrote:> Is there a way I can have print statements in Rails code that will > go either to > the WEBrick console (prefered) or to a log file? > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Steve: You can use: warn "Some string to warn" to print to the WEBrick console. I use this all the time. Thanks, Tristan ------------------------------ Message: 4 Date: Thu, 7 Jul 2005 22:43:30 +0000 (UTC) From: Steve Downey <sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> Subject: [Rails] Rails equivalent to System.out.println? To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: <loom.20050708T004153-748-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org> Content-Type: text/plain; charset=us-ascii Is there a way I can have print statements in Rails code that will go either to the WEBrick console (prefered) or to a log file?