Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1766

Consistent log severity level guards and statements

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.5
    • Fix Version/s: 3.5.0
    • Component/s: None
    • Labels:
      None

      Description

      A log statement should be guarded by its matching severity level. A log statement like

      if (LOG.isTraceEnabled()) {
      LOG.info("Session closing: 0x" + Long.toHexString(sessionId));

      doesn't make much sense because the log message is only printed out when TRACE-level is enabled. This inconsistency was possibly introduced when developers demoted the original log statement from INFO but forgot to change its corresponding log severity level.

        Attachments

          Activity

            People

            • Assignee:
              jackie.chang Jackie Chang
              Reporter:
              jackie.chang Jackie Chang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: