I’ve been using Ray Camden’s and Adam Podolnick’s ColdFire Firebug extension for a little while now. For those who haven’t tried it yet, the Firefox extension displays ColdFusion debugging info in a separate panel instead of appending it directly to the bottom of each page. It’s powerful stuff if you’ve ever had a page layout mangled by the vanilla debug dump.

Part of the setup for using ColdFire is deploying a customized debugging cfm template to your server. I never knew this — but ColdFusion actually uses a cfm template to parse and format the debugging output that ends up on each page. You can actually edit this file to customize the output on your system.

I wanted to get ColdFire working on our shared development server at work. But I knew not all of the developers would be on board to start. Luckily, the debugging cfm executes within each application. So the session and application variable scopes are available inside it.

The server debug template can alternate between the default debugging dump and ColdFire formatted output by checking for the existence of a session variable. By default, the server will append the default debug information. But each developer can set a session variable inside an application event or on individual templates to fire the ColdFire formatted output.

This is what your debug template looks like:

<cfif IsDefined("SESSION")
   AND IsStruct(SESSION)
   AND StructCount(SESSION) GT 0
   AND IsDefined("SESSION.UseColdFireDebugging")
   AND SESSION.UseColdFireDebugging EQ true>

   <!— Place the contents of ColdFire.cfm here —>

<cfelse>

   <!— Place the contents of your classic.cfm or custom debug template here —>

</cfif>