On Tue, Mar 06, 2007 at 09:28:46PM +0100, Jamal S. wrote :
I was wondering if I could sent any messages to the logger (console
command) in RoR, I saw someone do it, I just cannot remember what he
wrote.
Action Pack provides a logger. Have a look to ri Logger:
you can use: logger.info(‘French cheese rocks’), logger.fatal(‘Django
sucks’), … Those are writtent in log/*.log
You can also use breakpoints (ruby script/breakpointer) for debugging.
On Tue, Mar 06, 2007 at 09:28:46PM +0100, Jamal S. wrote :
I was wondering if I could sent any messages to the logger (console
command) in RoR, I saw someone do it, I just cannot remember what he
wrote.
Action Pack provides a logger. Have a look to ri Logger:
you can use: logger.info(‘French cheese rocks’), logger.fatal(‘Django
sucks’), … Those are writtent in log/*.log
You can also use breakpoints (ruby script/breakpointer) for debugging.
I did what you wrote, but I cannot find the output anywhere on the
screen :S any other easy way to debug my web application? please
If you’re running in development mode, the output will be written to
log/development.log. I tend to leave a terminal open running ‘tail -f
log/development.log’.
Because all output is rendered through a View, it’s not trivial to do
debug writes into the HTML itself, like you would in PHP, but the
logfile is a better approach anyway.
Gwyn.
I’m running ruby under Windows, we don’t have tail command?
I did what you wrote, but I cannot find the output anywhere on the
screen :S any other easy way to debug my web application? please
If you’re running in development mode, the output will be written to
log/development.log. I tend to leave a terminal open running ‘tail -f
log/development.log’.
Because all output is rendered through a View, it’s not trivial to do
debug writes into the HTML itself, like you would in PHP, but the
logfile is a better approach anyway.
On Tue, Mar 06, 2007 at 09:14:30PM -0000, Gwyn Morfey wrote :
Because all output is rendered through a View, it’s not trivial to do
debug writes into the HTML itself, like you would in PHP, but the
logfile is a better approach anyway.
You can use @debug(params) for instance.
A ugly hack would be:
logger.warn(‘poy!’) in the controller
File.read("#{RAILS_ROOT}/log/development.log") in the view