On Mon, Jan 18, 2010 at 8:04 AM, Michael Guterl <li...@ruby-forum.com> wrote:
> Marnen Laibow-Koser wrote:
>> Ralph Shnelvar wrote:
>>> newbie here ...
>>>
>>> I am tracing logic putting puts and logger.info calls in my code.
>>>
>>> I _think_ Rails is buffering output so that I can't see what happens
>>> until I close out webrick.
>>
>> But you are probably wrong.  If you watch the log scroll by, you will
>> generally see puts and logger output immediately.
>>
>>>
>>> How do I tell Rails (or whatever) that output is not to be buffered?
>>
>> You should not need to.
>>
>> Also, get familiar with ruby-debug and test-first development.  These
>> two things will drastically reduce your need for logging.
>>
>
> Dude, don't be such a dick.  Logging doesn't necessarily have to do with
> debugging or test-first development.
>

Actually they do. Logging is a form of debugging, and often is
suggested as the first form before jumping into a debugger and walking
through code.

As you get better at test driven development, your need for logging
and debugging go down.

Of course there is logging that you do just to monitor the health of
your application, but since the OP said, "I am tracing logic putting
puts and logger.info calls in my code." it seems he is using logging
and puts to debug his application.

That said, if you are on a *NIX machine, including Mac, it's not Rails
or Ruby that is buffering but the OS. Not sure if there is anything
you can do about that. Coming from the Java world, I used to always
put my debug output to standard error since that was not buffered and
you saw it in real time.
-- 
Curtis Cooley
curtis.coo...@gmail.com
home:http://curtiscooley.com
blog:http://ponderingobjectorienteddesign.blogspot.com
===============
Leadership is a potent combination of strategy and character. But if
you must be without one, be without the strategy.
-- H. Norman Schwarzkopf
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to