geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1309249 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo/j2ee/jaxbmodel/internal/ org.apache.geronimo.jaxbmodel.common/src/main/java/org/apache/geronimo/jaxbmode...
Date Wed, 04 Apr 2012 05:11:13 GMT
Author: gawor
Date: Wed Apr  4 05:11:12 2012
New Revision: 1309249

URL: http://svn.apache.org/viewvc?rev=1309249&view=rev
Log:
improve gep tracing - include timestamps

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo/j2ee/jaxbmodel/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jaxbmodel.common/src/main/java/org/apache/geronimo/jaxbmodel/common/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaxbmodel/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.runtime.v30/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoServerBehaviour.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/UpdateServerStateTask.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/internal/Trace.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo/j2ee/jaxbmodel/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo/j2ee/jaxbmodel/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo/j2ee/jaxbmodel/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo/j2ee/jaxbmodel/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.j2ee.jaxbmodel.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.j2ee.jaxbmodel.Activator;
 import org.apache.geronimo.runtime.common.log.Logger;
 
@@ -26,6 +29,8 @@ import org.apache.geronimo.runtime.commo
  */
 public class Trace {
 
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
+
     /**
      * Finest trace event.
      */
@@ -49,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -108,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -120,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    } 
-}
\ No newline at end of file
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jaxbmodel.common/src/main/java/org/apache/geronimo/jaxbmodel/common/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jaxbmodel.common/src/main/java/org/apache/geronimo/jaxbmodel/common/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jaxbmodel.common/src/main/java/org/apache/geronimo/jaxbmodel/common/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jaxbmodel.common/src/main/java/org/apache/geronimo/jaxbmodel/common/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.jaxbmodel.common.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.jaxbmodel.common.Activator;
 import org.apache.geronimo.runtime.common.log.Logger;
 
@@ -26,6 +29,8 @@ import org.apache.geronimo.runtime.commo
  */
 public class Trace {
 
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
+
     /**
      * Finest trace event.
      */
@@ -49,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -108,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -120,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    } 
-}
\ No newline at end of file
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaxbmodel/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaxbmodel/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaxbmodel/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaxbmodel/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.jee.jaxbmodel.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.jee.jaxbmodel.Activator;
 import org.apache.geronimo.runtime.common.log.Logger;
 
@@ -26,6 +29,8 @@ import org.apache.geronimo.runtime.commo
  */
 public class Trace {
 
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
+
     /**
      * Finest trace event.
      */
@@ -49,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -108,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -120,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    } 
-}
\ No newline at end of file
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.runtime.v30/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.runtime.v30/pom.xml?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.runtime.v30/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.runtime.v30/pom.xml Wed Apr  4 05:11:12 2012
@@ -33,7 +33,7 @@
     </parent>
 
     <properties>
-        <geronimoVersion>3.0-SNAPSHOT</geronimoVersion>
+        <geronimoVersion>3.0-beta-2-SNAPSHOT</geronimoVersion>
     </properties>
     <build>
         <resources>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.core.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.core.Activator;
 
@@ -26,6 +29,8 @@ import org.apache.geronimo.st.core.Activ
  */
 public class Trace {
 
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
+
     /**
      * Finest trace event.
      */
@@ -49,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -108,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -120,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    } 
-}
\ No newline at end of file
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,10 +16,12 @@
  */
 package org.apache.geronimo.st.ui.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.ui.Activator;
 
-
 /**
  * Helper class to route trace output.
  *
@@ -27,6 +29,8 @@ import org.apache.geronimo.st.ui.Activat
  */
 public class Trace {
 
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
+
     /**
      * Finest trace event.
      */
@@ -50,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -80,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -109,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -121,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    }   
-}
\ No newline at end of file
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v11.core.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.st.v11.core.Activator;
 
 /**
@@ -25,6 +28,8 @@ import org.apache.geronimo.st.v11.core.A
  */
 public class Trace {
 
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
+
     /**
      * Finest trace event.
      */
@@ -70,15 +75,31 @@ public class Trace {
      *            a throwable
      */
     public static void trace(byte level, String s, Throwable t) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
+        }
+
+        System.out.println(buildMessage(s));
+        if (t != null) {
+            t.printStackTrace(System.out);
+        }
+    }
 
-        System.out.println(Activator.PLUGIN_ID + ":  " + s);
-        if (t != null)
-            t.printStackTrace();
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
     }
     
-     /**
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
+    /**
      * Trace the given message 
      * 
      * @param tracePoint
@@ -95,17 +116,17 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" );
     }   
+
     public static void tracePoint(String tracePoint, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" );
-        }
-        else {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" );
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()");
+        } else {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(");
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
-                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]" );
+                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]");
             }
-            trace(Trace.INFO, ")" );
+            trace(Trace.INFO, ")");
         }
-    }  
-}
\ No newline at end of file
+    } 
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v11.ui.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v11.ui.Activator;
 
@@ -25,6 +28,8 @@ import org.apache.geronimo.st.v11.ui.Act
  * @version $Rev$ $Date$
  */
 public class Trace {
+    
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
     /**
      * Finest trace event.
@@ -44,14 +49,16 @@ public class Trace {
      * cancel trace event.
      */
     public static int CANCEL = 8;
-    
-    private static Logger log;
-    static {
-    	log = Logger.getInstance();
-    }
+
     /**
      * Trace constructor comment.
      */
+    private static Logger log;
+    
+    static {
+        log = Logger.getInstance();
+    }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -100,38 +123,41 @@ public class Trace {
      * @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"
+     * @param parms
+     *            Method parameter(s) 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, boolean opt) {
+    public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
-    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "] )" , opt);
+    
+    public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
+            for ( int ii=0; ii<parms.length; ii++) {
+                Object parm = parms[ii];
+                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]" , opt);
+            }
+            trace(Trace.INFO, ")" ,opt);
+        }
+    }    
+    
+    public static void trace(String tracePoint, String classDotMethod, boolean opt) {
+        tracePoint(tracePoint, classDotMethod, opt);
+    }
+
+    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
+        tracePoint(tracePoint, opt, classDotMethod, parms);
     }
 
-    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1, Object parm2) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
-                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "] )" , opt );
-    }
-    public static void trace(String tracePoint, boolean opt, 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()) + "] )" , opt );
-    }
-    public static void trace(String tracePoint, boolean opt, 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()) + "] )" , opt );
-    }
-    public static void trace(String tracePoint, boolean opt, 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()) + "] )" , opt );
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
     }
-}
\ No newline at end of file
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoServerBehaviour.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoServerBehaviour.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoServerBehaviour.java Wed Apr  4 05:11:12 2012
@@ -98,7 +98,7 @@ public class GeronimoServerBehaviour ext
 		try {
 			return getKernel() != null && kernel.isRunning();
 		} catch (SecurityException e) {
-			Trace.trace(Trace.SEVERE, "Invalid username and/or password.", e);
+			Trace.trace(Trace.ERROR, "Invalid username and/or password.", e);
 
 			pingThread.interrupt();
 			if (getServer().getServerState() != IServer.STATE_STOPPED) {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/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/main/java/org/apache/geronimo/st/v20/core/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v20.core.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.st.v20.core.Activator;
 
 /**
@@ -24,25 +27,29 @@ import org.apache.geronimo.st.v20.core.A
  * @version $Rev$ $Date$
  */
 public class Trace {
+    
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
     /**
      * Finest trace event.
      */
-    public static byte INFO = 0;
+    public static int INFO = 1;
 
     /**
      * Warning trace event.
      */
-    public static byte WARNING = 1;
+    public static int WARNING = 2;
 
     /**
-     * Severe trace event.
+     * error trace event.
      */
-    public static byte SEVERE = 2;
+    public static int ERROR = 4;
 
     /**
-     * Trace constructor comment.
+     * cancel trace event.
      */
+    public static int CANCEL = 8;
+
     private Trace() {
         super();
     }
@@ -55,7 +62,7 @@ public class Trace {
      * @param s
      *            a message
      */
-    public static void trace(byte level, String s) {
+    public static void trace(int level, String s) {
         trace(level, s, null);
     }
 
@@ -69,17 +76,30 @@ public class Trace {
      * @param t
      *            a throwable
      */
-    public static void trace(byte level, String s, Throwable t) {
-    	if (Activator.getDefault() == null
-				|| !Activator.getDefault().isDebugging())
-			return;
-
-        System.out.println(Activator.PLUGIN_ID + ":  " + s);
-        if (t != null)
-            t.printStackTrace();
-        
+    public static void trace(int level, String s, Throwable t) {
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
+            return;
+        }
+        System.out.println(buildMessage(s));
+        if (t != null) {
+            t.printStackTrace(System.out);
+        }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -95,19 +115,28 @@ public class Trace {
      *            Return value if the trace point is an "Exit"
      */
     public static void tracePoint(String tracePoint, String classDotMethod) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" );
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()");
     }   
+    
     public static void tracePoint(String tracePoint, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" );
-        }
-        else {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" );
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()");
+        } else {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(");
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
-                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]" );
+                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]");
             }
-            trace(Trace.INFO, ")" );
+            trace(Trace.INFO, ")");
         }
-    }   
+    }    
+    
+    public static void traceEntry(String classDotMethod, Object... parms) {
+        tracePoint("Entry", classDotMethod, parms);
+    }
+    
+    public static void traceExit(String classDotMethod, Object... parms) {
+        tracePoint("Exit", classDotMethod, parms);
+    }
 }
+

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v21.core.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v21.core.Activator;
 
@@ -25,6 +28,8 @@ import org.apache.geronimo.st.v21.core.A
  * @version $Rev$ $Date$
  */
 public class Trace {
+    
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
     /**
      * Finest trace event.
@@ -49,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -108,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -120,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    } 
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v21.ui.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v21.ui.Activator;
 
@@ -25,6 +28,8 @@ import org.apache.geronimo.st.v21.ui.Act
  * @version $Rev$ $Date$
  */
 public class Trace {
+    
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
     /**
      * Finest trace event.
@@ -44,14 +49,16 @@ public class Trace {
      * cancel trace event.
      */
     public static int CANCEL = 8;
-    
-    private static Logger log;
-    static {
-    	log = Logger.getInstance();
-    }
+
     /**
      * Trace constructor comment.
      */
+    private static Logger log;
+    
+    static {
+        log = Logger.getInstance();
+    }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -100,38 +123,41 @@ public class Trace {
      * @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"
+     * @param parms
+     *            Method parameter(s) 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, boolean opt) {
+    public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
-    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "] )" , opt);
+    
+    public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
+            for ( int ii=0; ii<parms.length; ii++) {
+                Object parm = parms[ii];
+                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]" , opt);
+            }
+            trace(Trace.INFO, ")" ,opt);
+        }
+    }    
+
+    public static void trace(String tracePoint, String classDotMethod, boolean opt) {
+        tracePoint(tracePoint, classDotMethod, opt);
     }
 
-    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1, Object parm2) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
-                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "] )" , opt );
-    }
-    public static void trace(String tracePoint, boolean opt, 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()) + "] )" , opt );
-    }
-    public static void trace(String tracePoint, boolean opt, 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()) + "] )" , opt );
-    }
-    public static void trace(String tracePoint, boolean opt, 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()) + "] )" , opt );
+    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
+        tracePoint(tracePoint, opt, classDotMethod, parms);
+    }
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
     }
-}
\ No newline at end of file
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,9 +16,11 @@
  */
 package org.apache.geronimo.st.v22.core.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v21.core.Activator;
-import org.eclipse.core.runtime.IStatus;
 
 /**
  * Helper class to route trace output.
@@ -26,6 +28,8 @@ import org.eclipse.core.runtime.IStatus;
  * @version $Rev$ $Date$
  */
 public class Trace {
+    
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
     /**
      * Finest trace event.
@@ -50,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -80,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -109,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -121,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    } 
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/UpdateServerStateTask.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/UpdateServerStateTask.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/UpdateServerStateTask.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/UpdateServerStateTask.java Wed Apr  4 05:11:12 2012
@@ -87,7 +87,7 @@ public class UpdateServerStateTask exten
     }
 
     private void updateServerState() {
-        Trace.trace(Trace.INFO, ">> " + server.getId() + " Updating Server State.", Activator.traceCore);
+        Trace.traceEntry(Activator.traceCore, "UpdateServerStateTask.updateServerState", server.getId());
         try {
             switch (server.getServerState()) {
             case IServer.STATE_STOPPED:
@@ -107,7 +107,7 @@ public class UpdateServerStateTask exten
         } catch (Exception e) {
             e.printStackTrace();
         }
-        Trace.trace(Trace.INFO, "<< " + server.getId() + " Updating Server State.", Activator.traceCore);
+        Trace.traceExit(Activator.traceCore, "UpdateServerStateTask.updateServerState", server.getId());
     }
 
     private void updateFromStopped() throws CoreException {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v30.core.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v30.core.Activator;
 
@@ -25,6 +28,8 @@ import org.apache.geronimo.st.v30.core.A
  * @version $Rev$ $Date$
  */
 public class Trace {
+    
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
     /**
      * Finest trace event.
@@ -49,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
     	log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
+        }
+        if (opt) {
         	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -108,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -120,5 +143,13 @@ public class Trace {
             }
             trace(Trace.INFO, ")" ,opt);
         }
-    }   
+    }    
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java?rev=1309249&r1=1309248&r2=1309249&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java Wed Apr  4 05:11:12 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v30.ui.internal;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v30.ui.Activator;
 
@@ -25,6 +28,8 @@ import org.apache.geronimo.st.v30.ui.Act
  * @version $Rev$ $Date$
  */
 public class Trace {
+    
+    private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
     /**
      * Finest trace event.
@@ -49,9 +54,11 @@ public class Trace {
      * Trace constructor comment.
      */
     private static Logger log;
+    
     static {
-    	log = Logger.getInstance();
+        log = Logger.getInstance();
     }
+    
     private Trace() {
         super();
     }
@@ -79,18 +86,34 @@ public class Trace {
      *            a throwable
      */
     public static void trace(int level, String s, Throwable t, boolean opt) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging()) {
             return;
-        if(opt) {
-        	log.trace(level, Activator.PLUGIN_ID, s, t);
         }
-        if(Activator.console) {
-            System.out.println(Activator.PLUGIN_ID + ":  " + s);
-            if (t != null)
-                t.printStackTrace();
+        if (opt) {
+            log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if (Activator.console) {
+            System.out.println(buildMessage(s));
+            if (t != null) {
+                t.printStackTrace(System.out);
+            }
         }
     }
 
+    private static String buildMessage(String msg) {
+        StringBuilder builder = new StringBuilder(50);
+        builder.append(formateCurrnetTime());
+        builder.append(" [").append(Activator.PLUGIN_ID).append("] ");
+        builder.append(msg);
+        return builder.toString();
+    }
+    
+    private static String formateCurrnetTime() {
+        synchronized (df) {
+            return df.format(new Date());
+        }
+    }
+    
     /**
      * Trace the given message 
      * 
@@ -108,11 +131,11 @@ public class Trace {
     public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
+    
     public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
-        if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
-        }
-        else {
+        if (parms == null || parms.length == 0) {
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" , opt);
+        } else {
             trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
@@ -121,4 +144,12 @@ public class Trace {
             trace(Trace.INFO, ")" ,opt);
         }
     }    
-}
\ No newline at end of file
+    
+    public static void traceEntry(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Entry", opt, classDotMethod, parms);
+    }
+    
+    public static void traceExit(boolean opt, String classDotMethod, Object... parms) {
+        tracePoint("Exit", opt, classDotMethod, parms);
+    }
+}



Mime
View raw message