I'll also +1 the idea of having addTraceStatement() do nothing if debugging
is off. I'm certain that for the default logWriter implementation there is
absolutely no point in writing log entries when debugging is off, because
that log writer only stores log data for the renderer, and as Ezra pointed
out the renderer is not even invoked when debugging is off. We ought to set
the expectation now for alternate logWriter implementations that they will
never be invoked if debugging is off.

As for making better use of the different debug modes for filtering, I think
it'd be better for those modes to be used for early filtering (during
event.addTraceStatement() or logWriter.write())  rather than late filtering
(during logRenderer.renderLog()).

Dennis

On Mon, Nov 30, 2009 at 4:50 PM, Ezra Parker <[email protected]> wrote:

> 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]<model-glue%[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]<model-glue%[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]<model-glue%[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