NEWBIE logger question here:
What’s the best way to log output to a development log for debugging purposes? How do you do it in a way that’s quick, simple, effective?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One option that I prefer over logging is using ruby debug. It allows you to put a break point anywhere in your code and inspect all local variables at that point in time. I find it more useful for tracking down bugs in cases where you have no friggin’ idea what’s going on and just want to look at everything.
Say you had a method like this and the behavior was not what you expected:
You could stick a debugger line in there:
You’ll be able to then do things like this to get a better idea of what is going on: