Skip to content

Instantly share code, notes, and snippets.

@sudar
Created June 30, 2011 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudar/1056796 to your computer and use it in GitHub Desktop.
Save sudar/1056796 to your computer and use it in GitHub Desktop.
public class ConditionalCompile {
private static final Logger LOGGER = Logger.getLogger(ConditionalCompile.class);
private final static boolean doLogging = false;
public static void importantMethod( ) {
// Do some set up code.
if (doLogging) {
LOGGER.debug("Set up complete, beginning phases.");
}
// do first part.
if (doLogging) {
LOGGER.debug("phase1 complete");
}
// do second part.
if (doLogging) {
LOGGER.debug("phase2 complete");
}
// Operation Completed
if (doLogging) {
LOGGER.debug("All phases completed successfully");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment