Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-7007

Add LOG.isDebugEnabled() guard for each LOG.debug()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      I am conducting research on log related bugs. I tried to make a tool to fix repetitive yet simple patterns of bugs that are related to logs. In these files, there are debug level logging statements containing multiple string concatenation without the if statement before them:

      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java, LOG.debug("splits["+j+"]="splits[j]" count=" + count);, 123
      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTextInputFormat.java, LOG.debug("splits["+j+"]="splits[j]" count=" + count);, 137
      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTextInputFormat.java, LOG.debug("splits[" + j + "]=" + splits[j] + " count=" + counter);, 254
      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTextInputFormat.java, LOG.debug("splits["+j+"]="splits[j]" count=" + counter);, 315
      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java, LOG.debug("splits[" + j + "]=" + splits.get(j) +" count=" + count);, 146
      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java, LOG.debug("splits["+j+"]="splits.get(j)" count=" + count);, 244

      Would you be interested in adding the if before these logging statements?

      Attachments

        Activity

          People

            Unassigned Unassigned
            MehranHassani Mehran Hassani
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: