classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A java DEBUG flag


From: Stuart Ballard
Subject: Re: A java DEBUG flag
Date: Tue, 28 Nov 2000 10:27:50 -0500

Brian Jones wrote:
> 
> I have thought of one problem however.  It might be more useful to
> break down debugging into at least package specific flags as opposed
> to turning on debugging for the entire world with this one flag... and
> I'd like a better name than GCJDEBUG... ideas?

Suggestion:

Create a bunch of classes in the gnu.java.debug package called DebugFoo
(where Foo is the particular thing to be debugged). Each of these
classes has a single public static final boolean ON.

In the configure process, provide a way to specify which values of "Foo"
should be debugged (eg --with-debug=Foo,Bar) and set ON to true or false
based on whether Foo is in the list passed to with-debug.

Each file can then import gnu.java.debug.* and then use "if
(DebugFoo.ON)" to perform debugging.

Adding a new Foo is as easy as adding a new DebugFoo.java.in file in
gnu/java/debug (because the configure system would be designed to work
with all files in that directory, rather than having a hardcoded list of
available debug flags).

This could be made as granular or non-granular as we want - for example,
we might have DebugSerialization separate from other java.io debugging,
but then have all java.awt debugging done by the same flag (despite
there being lots of packages). Thus, the debug flag is "per thing that
has useful debugging messages" rather than per-package or
per-anything-else.

Thoughts?

Stuart.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]