You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by mc...@apache.org on 2007/10/26 06:04:53 UTC

svn commit: r588503 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/org/apache/geronimo/st/v20/core/internal/Trace.java

Author: mcconne
Date: Thu Oct 25 21:04:52 2007
New Revision: 588503

URL: http://svn.apache.org/viewvc?rev=588503&view=rev
Log:
Enhance trace capabilities

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/org/apache/geronimo/st/v20/core/internal/Trace.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/org/apache/geronimo/st/v20/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/org/apache/geronimo/st/v20/core/internal/Trace.java?rev=588503&r1=588502&r2=588503&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/org/apache/geronimo/st/v20/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/org/apache/geronimo/st/v20/core/internal/Trace.java Thu Oct 25 21:04:52 2007
@@ -25,56 +25,100 @@
  */
 public class Trace {
 
-	/**
-	 * Finest trace event.
-	 */
-	public static byte INFO = 0;
-
-	/**
-	 * Warning trace event.
-	 */
-	public static byte WARNING = 1;
-
-	/**
-	 * Severe trace event.
-	 */
-	public static byte SEVERE = 2;
-
-	/**
-	 * Trace constructor comment.
-	 */
-	private Trace() {
-		super();
-	}
-
-	/**
-	 * Trace the given text.
-	 * 
-	 * @param level
-	 *            the trace level
-	 * @param s
-	 *            a message
-	 */
-	public static void trace(byte level, String s) {
-		trace(level, s, null);
-	}
-
-	/**
-	 * Trace the given message and exception.
-	 * 
-	 * @param level
-	 *            the trace level
-	 * @param s
-	 *            a message
-	 * @param t
-	 *            a throwable
-	 */
-	public static void trace(byte level, String s, Throwable t) {
-		if (!Activator.getDefault().isDebugging())
-			return;
-
-		System.out.println(Activator.PLUGIN_ID + ":  " + s);
-		if (t != null)
-			t.printStackTrace();
-	}
-}
\ No newline at end of file
+    /**
+     * Finest trace event.
+     */
+    public static byte INFO = 0;
+
+    /**
+     * Warning trace event.
+     */
+    public static byte WARNING = 1;
+
+    /**
+     * Severe trace event.
+     */
+    public static byte SEVERE = 2;
+
+    /**
+     * Trace constructor comment.
+     */
+    private Trace() {
+        super();
+    }
+
+    /**
+     * Trace the given text.
+     * 
+     * @param level
+     *            the trace level
+     * @param s
+     *            a message
+     */
+    public static void trace(byte level, String s) {
+        trace(level, s, null);
+    }
+
+    /**
+     * Trace the given message and exception.
+     * 
+     * @param level
+     *            the trace level
+     * @param s
+     *            a message
+     * @param t
+     *            a throwable
+     */
+    public static void trace(byte level, String s, Throwable t) {
+        if (!Activator.getDefault().isDebugging())
+            return;
+
+        System.out.println(Activator.PLUGIN_ID + ":  " + s);
+        if (t != null)
+            t.printStackTrace();
+    }
+
+    /**
+     * Trace the given message 
+     * 
+     * @param tracePoint
+     *            The trace point (e.g., "Exit", "Entry", "Constructor", etc....
+     *            
+     * @param classDotMethod
+     *            The class name + method name (e.g., "Class.method()")
+     *            
+     * @param parm1,2,3,4,5
+         *            Method parameters if the trace point is an "Entry"
+         *            or
+         *            Return value if the trace point is an "Exit"
+     */
+    public static void trace(String tracePoint, String classDotMethod) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" );
+    }   
+    public static void trace(String tracePoint, String classDotMethod, Object parm1) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "] )" );
+    }
+
+    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "] )" );
+    }
+    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+                                                                 "parm3=[" + (parm3 == null ? null : parm3.toString()) + "] )" );
+    }
+    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+                                                                 "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
+                                                                 "parm4=[" + (parm4 == null ? null : parm4.toString()) + "] )" );
+    }
+    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+                                                                 "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
+                                                                 "parm4=[" + (parm4 == null ? null : parm4.toString()) + "], " +
+                                                                 "parm5=[" + (parm5 == null ? null : parm5.toString()) + "] )" );
+    }
+}