You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wh...@apache.org on 2002/10/29 17:52:08 UTC

cvs commit: xml-axis-wsif/java/src/org/apache/wsif/logging Trc.java

whitlock    2002/10/29 08:52:08

  Modified:    java/src/org/apache/wsif/logging Trc.java
  Log:
  Enable trace to trace itself
  
  Revision  Changes    Path
  1.8       +13 -0     xml-axis-wsif/java/src/org/apache/wsif/logging/Trc.java
  
  Index: Trc.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/logging/Trc.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Trc.java	18 Sep 2002 15:38:19 -0000	1.7
  +++ Trc.java	29 Oct 2002 16:52:07 -0000	1.8
  @@ -98,6 +98,12 @@
       private static Log log = LogFactory.getLog(wsifPackageName+".*");
       public static boolean ON = log.isDebugEnabled();
   
  +    private static Log traceLog = LogFactory.getLog(wsifPackageName+".logging.*");
  +    /**
  +     * traceTrace means "is trace itself being traced?"
  +     */
  +    private static boolean traceTrace = traceLog.isDebugEnabled();
  +
       private final static String ENTRY = "ENTRY";
       private final static String EXIT = "EXIT ";
       private final static String EXCEPTION = "EXCEPTION";
  @@ -1114,6 +1120,7 @@
           PrintWriter pw = new PrintWriter(sw);
           e.printStackTrace(pw);
           String stack = sw.getBuffer().toString();
  +        if (traceTrace) traceLog.debug("TRACE stack="+stack);
   
           // The next while loop tries to find the method that called
           // Trc. The method name will have (...parmeters...) after it
  @@ -1123,6 +1130,8 @@
           String tok = null;
           while (st1.hasMoreTokens()) {
               tok = st1.nextToken();
  +            if (traceTrace) traceLog.debug("TRACE token="+tok);
  +            
               if (tok.indexOf("(") == -1)
                   continue;
   
  @@ -1134,6 +1143,7 @@
               if (foundWsifLogging)
                   break;
           }
  +        if (traceTrace) traceLog.debug("TRACE broken out token="+tok);
   
           // Indent the method name by the number of WSIF calls 
           // higher up the stack. This improves readability. There
  @@ -1151,6 +1161,7 @@
           int idx = tok.indexOf("(");
           if (idx != -1)
               tok = tok.substring(0, idx);
  +        if (traceTrace) traceLog.debug("TRACE token="+tok);
   
           // Now strip off the WSIF package name off the front of 
           // the class name. All WSIF class names are unique, so 
  @@ -1165,12 +1176,14 @@
               while (st2.hasMoreTokens()) {
                   previous = result;
                   result = st2.nextToken();
  +                if (traceTrace) traceLog.debug("TRACE result="+result);
               }
               if (previous != null)
                   result = previous + "." + result;
           } else
               result = tok;
   
  +        if (traceTrace) traceLog.debug("TRACE appending result="+result);
           buff.append(result);
       }