There's more than one way to do things | |
PerlMonks |
How do I get Cluck output into a log file?by tphyahoo (Vicar) |
on Dec 29, 2004 at 13:37 UTC ( [id://417978]=perlquestion: print w/replies, xml ) | Need Help?? |
tphyahoo has asked for the wisdom of the Perl Monks concerning the following question:
O wise ones,
I have a very simple debugging methodology for now, I just rolled my own logMessage function and stuck it in a module. logMessage outputs the message to the dos window ongoingly (winxp/ASPN) and also writes it to a log file. I messed around with the perl debugger, but I just wound up liking this way better. This was working fine, until I started using Carp. Problem is if, from inside a module, I do something like
I wind up with in my log.txt file. The messages get output to stdout, but I guess cluck is returning 1 instead of the debugging message to my logMessage() function. How do I get the actual message out of cluck so I can pass it to another function? Here is the complete code for testcarp.pl, testcarp.pm, logger.pm, which all sit together in their own directory and work fine, other than the output to log.txt.
I know there are other frameworks for dealing with logging and debugging, and if anybody would care to comment on how I could be doing this better, fire away. Thank you, o monks! thomas.
Back to
Seekers of Perl Wisdom
|
|