I am programming Android applications, and the best way here may or may not be the same as Java in general.
I simply want to be able to set a debug flag that will on
I think that writing tests is better alternative than adding DEBUG code.
My point is that when you write test for some component/method/class you don't pollute your original source code with some redundant debug code.