[Zope-Coders] Re: [Zope-Checkins] CVS: Zope/doc -
CHANGES.txt:1.535.2.107
Chris McDonough
chrism@zope.com
17 May 2003 15:11:32 -0400
FWIW, the reason I made the change was because I went through a ~ 3-hour
debugging session attempting to figure out why my tests for a particular
package wouldn't run. It turned out that I had a line like:
Globals.InitializeClass(Foo)
... in one of my modules, where 'Foo' was undefined.
But I didn't know this because the Zope product import machinery ate the
exception at product initialization time.
When running Zope as a server, this is typically not a problem because
the actual error does get written to zLOG. When running tests, however,
you typically don't send log output to anywhere valuable.
I *could* have turned logging on during the test (by setting
"STUPID_LOG_FILE=some_filename"). Had I turned logging on, I might have
seen the message and quickly fixed my problem. However, IMHO, you
shouldn't need to rely on log output during test execution.
An alternate solution to this problem is to allow z2.py to grow a
'--test" option rather than relying on the debug mode switch. However,
personally, I'll never remember to use it and I'll almost certainly need
to go through the same marathon debugging session to remind me that I
should have done so. ;-)
- C
On Sat, 2003-05-17 at 14:46, Fred L. Drake, Jr. wrote:
>
> Paul Winkler writes:
> > Is there now a separate flag for this behavior, or is it *only* toggled
> > by the doing-too-much-already "debug mode"?
>
> Chris responded:
> > The later.
>
> This conversation is quite interesting. Chris's change makes debug
> mode *not* do something that it should never have done to begin with.
> Yes, it's a change. Yes, debug mode now differs from production mode
> in another way. But the change isn't making debug mode do more; it
> does less now.
>
> >From where I stand, I wouldn't want product initialization errors to
> be masked in production mode either unless I specifically asked for it
> on the command line.
>
>
> -Fred
>
> --
> Fred L. Drake, Jr. <fred at zope.com>
> PythonLabs at Zope Corporation
>
> _______________________________________________
> Zope-Coders mailing list
> Zope-Coders@zope.org
> http://mail.zope.org/mailman/listinfo/zope-coders