On Thu, Jul 19, 2001 at 01:43:32PM -0700, Jonathan Reichhold wrote:
> Actually I've got a thought on how to add in debug messages without recompiling.  
>For a horrible hack say I've got a java class
> like:
> 
> //Constants.java
> public class Constants{
>     public static boolean isDebug(){return true;}
> }
> 
> And in my main code I call:
> if(Constants.isDebug()) log(someNastyFunction());
> 

But why don't you have two Constants.java of this type:

public class Constants {
    publict static final boolean DEBUG = true; // or false
}


and:

if( Constants.DEBUG ) {
    log( ... );
}

incze

Reply via email to