I've been working with a lot of code recently that I didn't write and the code flow is very hard to follow. A lot of times there's no clear execution path flow and I'm finding fixing problems is very time consuming because I'm having to jump around to a bunch of seemingly unrelated files to find where the problem actually is.
One of the things I seem to be having to do a lot is dump out either little "I'm here" messages or having to output the SQL statements that are getting executed so I can run them in SQL Query Analyzer to find out what the results are and what the query really should be.
I've found myself writing a lot of <cfif cgi.remote_addr EQ "my.ip.addr.ess"> lines in order to only output that data to myself. This morning I decided I should just write a tag that checks the CF Admin for a list of valid Debugging IPs and uses that to decide if code should be excuted.
Thanks to some code Ben Forta wrote for managing debugging addresses without having CF Administrator access, I was able to put together this little tag.
In a nutshell, if IP address of the remote computer isn't found in the ColdFusion Administrator's "Debugging IP Addresses", then the code in between the starting and ending <cf_debugOutput> tags won't be executed. Feel free to use the source code however you want. Just copy-n-paste the below code into a file called "debugWrite.cfm" and copy it into your \CFusionMX\CustomTags folder.
NOTE:This tag requires ColdFusion MX or higher.