Best Way to Include Debug Code?

Posted by stormin986 on Stack Overflow See other posts from Stack Overflow or by stormin986
Published on 2010-04-27T03:43:32Z Indexed on 2010/04/27 5:33 UTC
Read the original article Hit count: 338

Filed under:
|
|
|

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 only execute certain portions of code when it's set to true––equiv to C++ setting a preprocessor #define DEBUG and using #ifdef DEBUG.

Is there an accepted or best way to accomplish this in Java?

Right now I'm just going to set a variable in my Application object, but I don't imagine this is the best way.

© Stack Overflow or respective owner

Related posts about java

Related posts about android