This adds a varargs `log' method to SystemLogger, and makes that class a subclass of Logger.

2006-06-28  Casey Marshall  <[EMAIL PROTECTED]>

        * gnu/classpath/debug/SystemLogger.java: extend Logger.
        (SYSTEM): declare as instance of SystemLogger; set it to such an
        instance.
        (<clinit>): removed debug lines.
        (<init>): new method.
        (logv): new method.

Committed.

### Eclipse Workspace Patch 1.0
#P classpath-ssl-nio
Index: gnu/classpath/debug/SystemLogger.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/classpath/debug/SystemLogger.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 SystemLogger.java
--- gnu/classpath/debug/SystemLogger.java       2 Aug 2005 20:12:08 -0000       
1.1.2.1
+++ gnu/classpath/debug/SystemLogger.java       28 Jun 2006 22:57:58 -0000
@@ -40,11 +40,12 @@
 
 import gnu.classpath.SystemProperties;
 import java.util.StringTokenizer;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
-public final class SystemLogger
+public final class SystemLogger extends Logger
 {
-  public static final Logger SYSTEM = Logger.getLogger ("gnu.classpath");
+  public static final SystemLogger SYSTEM = new SystemLogger();
 
   static
   {
@@ -60,12 +61,28 @@
             Component c = Component.forName (tok.nextToken ());
             if (c != null)
               PreciseFilter.GLOBAL.enable (c);
-            SYSTEM.log (java.util.logging.Level.INFO, "enabled: {0}", c);
+            SYSTEM.log (Level.INFO, "enabled: {0}", c);
           }
       }
+  }
 
-    java.util.logging.Handler[] h = SYSTEM.getHandlers ();
-    for (int i = 0; i < h.length; i++)
-        System.out.println (h[i]);
+  /**
+   * Keep only one instance of the system logger.
+   */
+  private SystemLogger()
+  {
+    super("gnu.classpath", null);
+  }
+  
+  /**
+   * Variable-arguments log method.
+   * 
+   * @param level The level to log to.
+   * @param format The format string.
+   * @param args The arguments.
+   */
+  public void logv(Level level, String format, Object... args)
+  {
+    log(level, format, args);
   }
 }

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to