Sam Farmer head shot

Sam Farmer

Growing up I never imagined I would play bass guitar for the Dave Matthews Band. And indeed it never happened.

But I have become a passionate and pretty good web developer.


debugClean, a ColdFusion Builder Extension to Check for Debug Free Code

Recently I wrote some code that ran beautifully on my machine. So beautiful in fact that if it was a painting it would be the Mona Lisa. I pushed it to stage and no one could get it to run.

The reason?

I had left in a console.log and cfdump output to file. The staging environment didn't like this one bit and laughed at my suggestion of the code being like the Mona Lisa.

So, I wrote ColdFusion Builder extension to check for debug code and called it debugClean. Its now up and downloadable on RIAForge. Full description:

Checks a file or folder for any debug code that should probably be stripped before moving to staging or production.

Looks for ColdFusion tags: - cfdump - writeDump - cflog - writeLog

Looks for JavaScript: - console.log

The tags and functions it looks for can be configured to your taste in the _config.cfm file.



Go get it, install it and only push our production ready code!

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
This is definitely going to be useful . . . thanks!
# Posted By Lola LB | 12/13/10 7:06 AM
Hi Sam, Nice post. Have you tried adding a check to compile the code for syntax errors? I have used the cfcompile executable before but am looking for a way to call the compile via an api.
# Posted By Mike Henke | 12/13/10 9:42 AM
@Lola: Thanks! Hope it proves to be useful.

@Mike: Nope. Wouldn't those errors be shown in the editor anyway?
# Posted By Sam Farmer | 12/13/10 4:29 PM
True, the errors should show in the editor but another check wouldn't hurt.
# Posted By Mike Henke | 12/14/10 12:54 PM
Could this be ported as a cfadmin extension? To allow it to work from there? Because this does sound very useful. But I don't use cf9 or cfbuilder.

Thanks
# Posted By Craig M. Rosenblum | 12/16/10 9:56 AM
@Mike: Yeah, I could see that being useful on a whole directory.

@Craig: Sure. It wouldn't be too hard to port the code over (its basically one file anyway!) to an admin extension.
# Posted By Sam Farmer | 12/17/10 12:40 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.7. Contact Blog Owner