is there a class helping in debugging?

Maybe you saw my connect2vertices images? No look here:
http://i51.tinypic.com/foumd.gif

The addon is to some degree complicated and with a lot of

print(“L87 info”, obj1,boj2)

or so.
I would like to use something more conveniënt …
One change : levelOfDebug = 1 # or 2 (more deep) etc level 0 “no debug message”

Something like this available?

Just found: pdb … someone with tips how to use it in blender (2.53)?
.