I was thinking a debug library may be useful. let me know what you
think.

Basically, I currently have 100 lines or so of "print" library in my
networking samples. These lines are all over the place.

print_string(serial_sw_data, icmp_str1)
-- some code
print_string(serial_sw_data, icmp_str1)

The problem is that it is difficult/messy to turn on and off this
debugging. I could write:

if NETWORKING_DEBUG = TRUE then
   print_string(serial_sw_data, icmp_str1)
end if
-- some code
if NETWORKING_DEBUG = TRUE then
   print_string(serial_sw_data, icmp_str1)
end if

but as you can see, that could get messy.

So, I was wondering if we could have a debug library that would
basically copy API of the print lib, but would have a main constant to
turn it on/off. In my example below, if you change DEBUG = FALSE, it
will not print anything.

include print
const DEBUG = TRUE
include debug

debug_print_string(serial_sw_data, icmp_str1)
-- some code
debug_print_string(serial_sw_data, icmp_str1)

Also, we could possibly have more then one debug library. debug_lvl1,
debug_lvl2, etc.

Matt.


-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to