User: oleg    
  Date: 00/10/03 05:13:13

  Modified:    src/main/org/jboss/logging ConsoleLogging.java
  Log:
  Date and time formats are now configurable (is brought into accord with FileLogging)
  
  Revision  Changes    Path
  1.3       +3 -5      jboss/src/main/org/jboss/logging/ConsoleLogging.java
  
  Index: ConsoleLogging.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/logging/ConsoleLogging.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConsoleLogging.java       2000/09/08 20:20:38     1.2
  +++ ConsoleLogging.java       2000/10/03 12:13:13     1.3
  @@ -19,7 +19,7 @@
    *      
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.2 $
  + *   @version $Revision: 1.3 $
    */
   public class ConsoleLogging
      implements ConsoleLoggingMBean, MBeanRegistration, NotificationListener
  @@ -29,8 +29,7 @@
       
      // Attributes ----------------------------------------------------
      PrintStream out, err;
  -   DateFormat dateFmt = new SimpleDateFormat("yyyy-MM-dd hh.mm");
  -   String format = "<{0}><{2}> {4}";
  +   String format = "<{0,date,yyyy-MM-dd} {0,time,hh.mm}><{2}> {4}";
      MessageFormat msgFmt = new MessageFormat(format);
      
      boolean verbose = false;
  @@ -64,8 +63,7 @@
      public synchronized void handleNotification(Notification n,
                                     java.lang.Object handback)
      {
  -      //AS FIXME this change is just a hack (dateFmt.format(...))
  -      Object[] args = new Object[] { dateFmt.format(new Date(n.getTimeStamp())), 
new Long(n.getSequenceNumber()), n.getUserData(), n.getType(), n.getMessage() };
  +            Object[] args = new Object[] { new Date(n.getTimeStamp()), new 
Long(n.getSequenceNumber()), n.getUserData(), n.getType(), n.getMessage() };
         if (n.getType().equals("Error") || n.getType().equals("Warning"))
            err.println(msgFmt.format(args));
         else         
  
  
  

Reply via email to