This is a random side point of all these if debug etc. Why not just have a debug() or logDebug() method, whose body has the if (DEBUG)? the outcome should be the same. If DEBUG is false, the method body will have nothing in it, and java will optimize out that call.