|P is for Practical|
What kind out output would you want from a module's Debug option?by ajt (Prior)
|on Apr 08, 2003 at 12:54 UTC||Need Help??|
ajt has asked for the
wisdom of the Perl Monks concerning the following question:
In an ideal world what kind of built-in debugging features would you like a module to have?
At the moment I'm working on an RSS module (XML::RSS::Tools), and I'm pretty sure it's near completion. During the development phase I have tended to scatter print statments throughout it to see what is going on, but now I'm looking at enabling proper end-user debugging information.
I've used some modules that dump staggering amounts of data to STDERR, and I've seen some that do pretty much nothing. I know there is the sophisticated Log4perl and simple Carp warn option. But which do people actually prefer?
My module is OO, and has a method to set a debug level, and read the level, and it's possible to dump the internal state of the module at various steps manually from the interface, but at the moment turning debugging on, doesn't actually do anything!
As I recently asked I don't want to bloat the module, When is a feature bloat?, but I think a debug option can be useful. This module interacts with data feeds that are outside the users control, so I think it's useful to debug things when you don't get the result you expect: XML::RSS; Using RSS; How do I clean RSS feeds to make them usable?; and Why so slow from CGI, but not command line?.