views:

30

answers:

1

Lets say I have i variable var witch is a pointer to another variable named user_id.

How do I puts var such that I can see in the console user_id = (whatever the value is)

Reason why I want to do this, is because I want to write a method called print_debug_block, where you give it an array of variables, and it prints in the following format:

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||  
var1 = valOfVar1  
var2 = valOfVar2  
var3 = valOfVar3  
etc  
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A: 

logger.debug() outputs to the log.

See http://guides.rubyonrails.org/debugging_rails_applications.html#the-logger

Ashley Williams
this is not what I asked for =p I'm trying to further simplify the debug process. opening files every time you want to check your vars ain't my cup of tea.
DerNalia
`tail -f log/development.log`
Ashley Williams
what does tail -f ... do?
DerNalia
`tail` is a unix utility to display the last part of a file, and the `-f` option keeps the output streaming when new text is added to the end of the file, so it's perfect for log files.
Ashley Williams