Did you know there is an IsDebugMode() function in ColdFusion? I just discovered this. This will be great for showing additional data when you are debugging your app. For example, you could leave this code in your order view page all the time:

<cfif IsDebugMode()>
    By the way here is the complete order:
    <cfdump var="#orderBean.toStruct()#">
</cfif>

IsDebugMode() will return true whenever you have debugging enabled in the Administrator and you are coming from one of the allowed debugging IP addresses. This works in Railo and OpenBD, too.

4 Comments

  1. Mike Henke says:

    So will we see a "tip of the day" daily?

  2. Ryan says:

    Past performance does not predict future results.

    Maybe 1 day a month.

  3. Mike K says:

    Good tip, didn't know that function existed.  I would have to use with caution, however, as there are times during debugging certain issues that I have to turn on debugging in a production environment.  While this action would otherwise be invisible to the user, having this code throughout and seeing dumps everywhere would send most users into cardiac arrest!

  4. Ryan says:

    Yes, in that case you'd definitely want to use the debugging IP list.