HBase
  1. HBase
  2. HBASE-10842

Some loggers not declared static final

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.98.1, 0.96.1.1
    • Fix Version/s: 0.99.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In a few of source files, the logger is defined as

      private final Log LOG = LogFactory.getLog(MyClass.class);
      

      This should be changed to static final.

      One question is about the following declaration:

      private final Log LOG = LogFactory.getLog(this.getClass());
      

      In this form, the logger can be shared by derived classes. But one will get NPE when logging in methods that are invoked inside the constructors.

      1. HBASE-10842.patch
        6 kB
        Richard Ding
      2. HBASE-10842.patch
        7 kB
        Richard Ding

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Richard Ding
            Reporter:
            Richard Ding
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development