Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5437

Use parametrized messages while logging.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Complexity:
      Low

      Description

      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 conventions.

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              samuel34 Samuel Male
              Reporter:
              samuel34 Samuel Male
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: