[ic] IC 5.2: is there a "debugging" mode?

Christopher Wenham cwenham at synesmedia.com
Mon Aug 2 11:44:44 EDT 2004


On Monday 02 August 2004 00:20, antitrust at vandervecken.com wrote:
> I ask, because I put a custom bit of Perl together to calculate shipping
> costs (after much frustration with shipping.asc - see below). If I make a
> typo in my Perl, the code simply doesn't work, and nothing shows up in
> error.log. This makes debugging - a bit difficult. After a lot of trial
> and error I have something stable and basic working, and am a bit loathe
> to change it.

 Yes, there's a combination of two things:

 1) Turn on debugging in interchange.cfg. EG:

Variable  DEBUG  1

 That will log to /tmp/icdebug by default. 

 On its own, this will not actually log anything useful to the debug file. You 
have to turn on the debugging statements that are littered around the 
Interchange source. So:

 2) Turn on the debugging lines in the .pm module under lib/Vend that's 
closest to what you're working on.

 Look for lines that look like this:

#::logDebug("A debugging statement would go here if this wasn't an example");

 And remove the # to enable the statement:

::logDebug("A debugging statement would go here if this wasn't an example");

Now restart Interchange and tail /tmp/icdebug to see what's going on.

 Of course, you *DO NOT* want to turn on all of the logDebug lines in all of 
the Interchange source. That would generate about a megabyte of debugging 
output for every page request. You only want to turn on the ones related to 
what you're debugging.

 Once you're done, you should comment-out all those lines again so they don't 
drag your performance down.

Regards,
-- 
Chris Wenham - Synesmedia, Inc.
http://www.synesmedia.com
516-620-4110 / 1-888-255-7573


More information about the interchange-users mailing list