Version 0 of Quick Debugging Feedback

Updated 2009-04-27 17:02:28 by WJG

(WJG) 27-Apr-09 We must all use the Tcl 'puts' to give debugging feedback to the console. As I like to know which proceedure produced what message I thought that I'd formalise the process with a few lines of code rather than typing in too much. Hence this simple inclusion to my script main header. I'm sure there's a better way of doing things but this only took me five minutes to throw together.

set VERBOSE true

if { $VERBOSE } {
    # print debug message and the proceedure from which it was called
    proc _DEBUG_ {str} { if {$::VERBOSE} { puts "DEBUG:\t[lindex [info level 1] 0]\t MSG: $str" } }
}

enter categories here