LOGGER.isDebugEnabled() Example Java

Why LOGGER.isDebugEnabled() condition need to check in all implementation of LOG messages? 

We all know logger bring app slowness if unnecessary, message will log in place, if we implement as mention below. We can avoid/control on logging message:

protected static final Logger LOG = Logger.getLogger(TutorialByExampleJavaLogger.class);
Make sure that whenever using LOG messages, check with LOGGER.isDebugEnabled() flag, so that when debugger is disabled, logs won't get printed to the log files.
if(LOG. isDebugEnabled())
    { /* print your log messages as you want to print*/
       LOG.info("Info type message") ;
       LOG.debug("Debug type message");

Feel free put your point of view if any....!!!


Please provide your input, it will honer for me...