CF_Debug Documentation v3.0
by Dan G. Switzer, II

Table Of Contents:


Introduction

CF_Debug was the first debugging tool written for ColdFusion. The first version was released about the same time that Allaire release ColdFusion v3.0. The goal of CF_Debug is to allow you to easily monitor execution times and values of variables within your scripts. The output is displayed within a pop-up window created using JavaScript, so the output of the original template is not altered.

This tag is released as un-encrypted freeware, so feel free to look at the code to see what's going on behind the scenes. If you modify the code, please send me a copy. I'll try and incorporate any changes you make into future versions of the tag. There's no money involved, but hey, you'll get listed as a contributor!

Sincerely,
Dan G. Switzer, II
dswitzer@pengoworks.com


Requirements

CF_Debug requires the following:


Installation

To install CF_Debug, do the following:


Getting Started

Using CF_Debug couldn't be easier. At any point in your template that you'd like to monitor the what the server is doing, simply insert the following code:

<CF_Debug>

Placing the <CF_Debug> command multiple times throughout your template will cause a seperate pop-up window to appear for each occurance of the tag. This will allow you to easily compare the values of your variables throughout the scripts execution.

NOTE: With the introduction of Allaire's ColdFusion v4 product line, they've included debugging tools built in to the ColdFusion Studio interface. This is also a useful debugging tool and is worth reading about.

Attributes

Below is a listing of each attribute and an indepth description of what the attribute is.
ATTRIBUTE DESCRIPTION
TURNON: Specify a comma-delimited list of scopes to watch. For example, if you only care about the VARIABLES scope, addding the attribute TURNON="VARIABLES" will only monitor the VARIABLES scope. (Defaults to all scopes.)
VARIABLES: Specify a comma-delimited list of variables in the VARIABLES scope to watch. This will check to see if the variable exists, if it does, the value will be displayed, otherwise the fact that it's undeclared is displayed. By default, CF_Debug reads in the contents of the calling script and parses out any variables being intialized via the <CFSET> tag.
COOKIE: Specify a comma-delimited list of variables in the COOKIE scope to watch. This will check to see if the variable exists, if it does, the value will be displayed, otherwise the fact that it's undeclared is displayed.
APPLICATION: Specify a comma-delimited list of variables in the APPLICATION scope to watch. This will check to see if the variable exists, if it does, the value will be displayed, otherwise the fact that it's undeclared is displayed. By default, CF_Debug will check to see if your using CF4 (or higher.) If you are, it will loop through the application structure pulling out the variables automatically.
SERVER: Specify a comma-delimited list of variables in the SERVER scope to watch. This will check to see if the variable exists, if it does, the value will be displayed, otherwise the fact that it's undeclared is displayed.
SESSION: Specify a comma-delimited list of variables in the SESSION scope to watch. This will check to see if the variable exists, if it does, the value will be displayed, otherwise the fact that it's undeclared is displayed. By default, CF_Debug will check to see if your using CF4 (or higher.) If you are, it will loop through the session structure pulling out the variables automatically.

Hints




What's New

Listed below is the revision history for CF_Debug. Please make sure to read this thoroughly before replacing older version of CF_Debug.
v3.0
Change code to optimize it for ColdFusion v4.0 and take advantage of newer functions not available in older version of ColdFusion.
Now reports execution time in milliseconds (CF4 or higher only)
Automatically detects session variables (CF4 or higher only)
Automatically detects application variables (CF4 or higher only)
Fixed bug which incorrectly reported the version number of the current ColdFusion Application Server
Added extended comments throughout source code—which should make it easier to follow what's going on behind the scenes
Each pop-up window pops up in a cascading fashion
Fixed bug which caused automatic detection of CLIENT variables to throw an error
v2.0
Changed name from "CF_GetVariables" to "CF_Debug"
Complete re-write of original version
Added the ability to automatically read in variables set through the <CFSET> statement located in the calling template.
Added support for all valid ColdFusion default scopes.
v1.0
First public release. Released as "CF_GetVariables."

Contributers

The following people have made suggestions or contribution that have helped shape CF_Debug to the great tool it is today:
      • James Smith
      • Jonathan Doklovic





Disclaimers

CF_Debug is not guarenteed to work with every server. I have taken every precaution to make sure that CF_Debug works with every version of ColdFusion (version 3+ and higher) on the NT platform.

Before using CF_Debug for the first time, be sure that you read the below agreement. Use of CF_Debug implies that you have read and agreed to the below statments.

Risk of Use
You understand that this Custom Tag may have errors and may produce unexpected results. You agree that any use of this Custom Tag will be entirely at your own risk.

No Warranty
THIS CUSTOM TAG IS PROVIDED "AS IS" AND WITHOUT WARRANTY, EXPRESS OR IMPLIED. PENGOWORKS.COM SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OR MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Limitation on Liability
IN NO EVENT WILL PENGOWORKS.COM BE LIABLE FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO ANY LOST PROFITS, LOST SAVINGS OR ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES, WHETHER RESULTING FROM IMPAIRED OR LOST DATA, SOFTWARE OR COMPUTER FAILURE OR ANY OTHER CAUSE, EVEN IF ALLAIRE IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY OTHER CLAIM BY YOU OR FOR ANY THIRD PARTY CLAIM. SOME STATES DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES SO THIS LANGUAGE MAY NOT APPLY. IN SUCH CASE, ALLAIRE'S LIABILITIES WILL BE LIMITED BY THE ABOVE LIMITATION OF REMEDIES PROVISION.