Any way to turn on/off a println in java (verbose mode)
Is there any way in Java that you can make a println appear only when
requested, not by default? Basically something similar to using "-v" in
many programs to give you verbose mode, with information on what is
happening.
For example let's say I have an if statement in a loop, and a simple
println that tells me whether the if statement evaluates to true for each
iteration of the loop. Is there any other way to toggle on/off it's
visibility other than commenting it out when I don't need it and uncomment
it when I do? Then saving it, recompiling it, etc.
It would make it a lot easier to see what is going on in my program, but
only when I want that much info. As I said, I am basically looking for a
way to implement a "verbose" mode that shows print statements, without
having to comment/uncomment save, recompile, etc. Does Java have anything
like this?
No comments:
Post a Comment