Use parametrized messages while logging.

In many old classes, the following convention was used while performing different levels of logging.

if(logger.isDebugEnabled()) { logger.debug(Entry number: + i + is + String.valueOf(entry[i])); }

Well that makes sense to me but according to our coding conventions, this should be avoided and just for quality assurance, even existing code found with such should be refactored cc: Logging conventionsLog).

Instead of using the above convention, use parameterized logging like below.

log.debug(The entry is {}., entry);

Below is a list of some of the affected classes.

Task tags

  • coding
  • java

Students who completed this task


Task type

  • done_all Quality Assurance