Behind the scenes, a config value of "true" is converted to "verbose",
and "false" to "none". The debug setting actually supports three
states: "verbose", "trace" and "none" -- although it appears that
support for the "trace" level was never completed (see lines 13-14 of
gesture/eventrequest/log/LogRenderer.cfc).

FWIW, the conditional statement that is currently used to render to
the debugging in ModelGlue.cfm is:

<cfif mg.configuration.debug neq "false" and mg.configuration.debug neq "none">

(Although I'm not really sure why the "false" case is present...)

I'm inclined to agree that it would probably be a good idea to return
out of addTraceStatement() if debugging is disabled -- can anyone
think of a reason not to do this?

--
Ezra Parker



On Mon, Nov 30, 2009 at 1:11 PM, Chris Blackwell <[email protected]> wrote:
> <cfdump> can be a real hog, so i think if we can avoid running it we should.
>  How about adding a check for the debug status at the top of
> addTraceStement() ?
> <cfif getModelGlue().getConfigSetting('debug') IS NOT true>
> <cfreturn />
> </cfif>
> something like that should work, although checking my config now, with the
> debug property set to "false" in coldspring.xml, modelglue is reporting a
> value of "none" for the debug config setting... whats up with that?
> chris
> 2009/11/30 Raymond Camden <[email protected]>
>>
>> Twice now in a CF9/ORM/MG3 application I've noticed something odd.
>> I'll get a timeout error and the tag involved will be cfdump,
>> specifically:
>>
>> EventContext.cfc:
>>
>> <cffunction name="addTraceStatement" access="public" returnType="Void"
>> output="false" hint="I add a message to the trace log.">
>>  <cfargument name="type" type="string" />
>>  <cfargument name="message" type="any" />
>>  <cfargument name="tag" type="string" default="" />
>>  <cfargument name="traceType" type="string" default="OK" />
>>
>>        <cfset arguments.time = getTickCount() />
>>
>>        <cfif not isSimpleValue(arguments.message)>
>>                <cfsavecontent variable="arguments.message"><cfdump
>> var="#arguments.message#" /></cfsavecontent>
>>        </cfif>
>>
>>        <cfset variables._logWriter.write(this, arguments) />
>> </cffunction>
>>
>> If I comment out the CFIF and let the error 'go through', it seems
>> simple enough. In my case it has been a simple matter of setting an
>> integer based column to a string. I don't know why the server would
>> time out just dumping it, but it does. After a few reloads the server
>> will crash.
>>
>> But anyway - my real question is - should addTraceStatement be running
>> when debugging is turned off? I added a cflog and see that it seems to
>> run quite often. Even if it runs quickly, that cfdump is a bit of a
>> waste if it doesn't actually end up getting used anywhere.
>>
>>
>> --
>>
>> ===========================================================================
>> Raymond Camden, ColdFusion Jedi Master
>>
>> Email    : [email protected]
>> Blog      : www.coldfusionjedi.com
>> AOL IM : cfjedimaster
>>
>> Keep up to date with the community: http://www.coldfusionbloggers.org
>>
>> --
>> Model-Glue Sites:
>> Home Page: http://www.model-glue.com
>> Documentation: http://docs.model-glue.com
>> Bug Tracker: http://bugs.model-glue.com
>> Blog: http://www.model-glue.com/blog
>>
>> You received this message because you are subscribed to the Google
>> Groups "model-glue" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/model-glue?hl=en
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to