mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
14.36.2015 a2376d93e545fff522eaaeba46b85766f8940f1a
OPENDJ-2547 Creating a debug target for a specific method actually traces messages for the whole class

DebugTracer.java:
In traceException(), if methodSettings exist, then make sure settings exist for the method that triggered logging.
1 files modified
17 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugTracer.java 17 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugTracer.java
@@ -154,17 +154,11 @@
          // If this method does have a specific setting
          // and it is not supposed to be logged, continue.
          if (mSettings != null)
          if (!shouldLog(mSettings, hasException))
          {
            if (!shouldLog(mSettings, hasException))
            {
              continue;
            }
            else
            {
              activeSettings = mSettings;
            }
            continue;
          }
          activeSettings = mSettings;
        }
        String sourceLocation = callerFrame.getFileName() + ":" + callerFrame.getLineNumber();
@@ -283,8 +277,9 @@
  /** Indicates if there is something to log. */
  private boolean shouldLog(TraceSettings settings, boolean hasException)
  {
    return settings.getLevel() == ALL
        || (hasException && settings.getLevel() == EXCEPTIONS_ONLY);
    return settings != null
        && (settings.getLevel() == ALL
          || (hasException && settings.getLevel() == EXCEPTIONS_ONLY));
  }
  /** Indicates if there is something to log. */