A few days ago I wrote:-

> You may want to turn on
> spectra debugging to see which tags are using up the execution time. I'm
> not near my development machine right now but later on I'll post some neat
> tags that can aid in debugging execution time.

Ok naturally I forgot all about this. :)

The normal tag to generate debug output is <cfa_tagDebugOutput>. This
generates a list of various spectra tags called during page generation.
Due to various issues with style sheets, javascript, etc. debug output is
mostly unreadable so I use a custom tag to catch the output generated by
<cfa_tagdebugoutput>. It's not very complicated:-

--- debugcatch.cfm

<cfswitch expression="#thistag.executionmode#">
        <cfcase value="START">
                <cfif not thistag.hasendtag>
                        <cfthrow message="no closing debugcatch tag">
                </cfif>
        </cfcase>
        <cfcase value="END">
                <cfmail to="<your-email-address-here>" from="<>"
                  subject="debug output from #CGI.SCRIPT_NAME#"
                  type="HTML">#thistag.generatedcontent#</cfmail>
                <cfset thistag.generatedcontent = "">
        </cfcase>
</cfswitch>

---

To use this in a spectra site I have created on OnRequestend.cfm in the
wwwroot that looks like this:

<cfif request.cfa.mode.debug>
<cf_debugcatch>
<cfa_tagDebugOutput>
</cf_debugcatch>
</cfif>

I hope this is of some use to somebody.

While we're on the subject of debugging, a lot of cfa_ tags do not
properly initialize or reset debugging info. While we're all busy
inserting <cfsetting> in the proper places in spectra system tags might I
also suggest that all cfa_ tags contain the following code at startup:

<cfsetting enablecfoutputonly="Yes">
<cfif request.cfa.mode.debug>
        <cfa_tagDebugBegin>
</cfif>

and the following code before the end of the template (or before <cfexit>)

<cfif request.cfa.mode.debug>
        <cfa_tagDebugEnd>
</cfif>
<cfsetting enablecfoutputonly="No">

This is done a number of places, but not everywhere. Isn't it a job for
QA to assure that these things are done in a consistent manner?

Finally, the Allaire web site, and the Allaire forums site in particular,
are hardly reachable ever since Allaire left Cambridge. Any idea when
these will be 100% available again?

Cheers
Michiel

-- 
Michiel Boland <[EMAIL PROTECTED]>
Digital Valley Internet Professionals
Plantsoen 17, Wageningen, The Netherlands
Phone: +31 317 465555, Fax: +31 317 460276

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to