Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-3925

Make Shell's -d and debug cmd behave the same

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 0.90.3, 0.90.7, 0.92.2, 0.94.3, 0.98.0, 0.95.2
    • 0.95.0
    • shell
    • Reviewed

    Description

      The -d option switches log4j to DEBUG and leaves the backtrace level at the default. When using the supplied debug command we only switch the backtrace, but I would think this also should set the log4j levels:

      # Debugging method
      def debug
        if @shell.debug
          @shell.debug = false
          conf.back_trace_limit = 0
        else
          @shell.debug = true
          conf.back_trace_limit = 100
        end
        debug?
      end
      

      could be something like

      # Debugging method
      def debug
        if @shell.debug
          @shell.debug = false
          conf.back_trace_limit = 0
          log_level = org.apache.log4j.Level::ERROR
        else
          @shell.debug = true
          conf.back_trace_limit = 100
          log_level = org.apache.log4j.Level::DEBUG
        end
        org.apache.log4j.Logger.getLogger("org.apache.zookeeper").setLevel(log_level)
        org.apache.log4j.Logger.getLogger("org.apache.hadoop.hbase").setLevel(log_level)
        debug?
      end
      

      Attachments

        1. HBASE-3925-v2.txt
          2 kB
          Liang Xie
        2. HBASE-3925.patch
          2 kB
          Liang Xie

        Activity

          People

            xieliang007 Liang Xie
            larsgeorge Lars George
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: