summaryrefslogtreecommitdiff
path: root/gnu/classpath/debug/SystemLogger.java
diff options
context:
space:
mode:
authorCasey Marshall <csm@gnu.org>2005-07-10 19:08:01 +0000
committerCasey Marshall <csm@gnu.org>2005-07-10 19:08:01 +0000
commita5ff243ee641c2120ede74173817f4194fbf833b (patch)
treeb9ce7a047504e3d2c726879878e022b8eaa3d9f5 /gnu/classpath/debug/SystemLogger.java
parente21a8d337ba4b9eeae52956fb23255d67b5aa43d (diff)
downloadclasspath-a5ff243ee641c2120ede74173817f4194fbf833b.tar.gz
2005-07-10 Casey Marshall <csm@gnu.org>
* gnu/classpath/debug/Component.java: new file. * gnu/classpath/debug/PreciseFilter.java: new file. * gnu/classpath/debug/SystemLogger.java: new file. * gnu/java/security/x509/X509Certificate.java (DEBUG, debug, debug): removed. (logger): new constant; use 'logger' with 'Component.X509' for debug messages throughout. (parse): always read the next DER value after reading the version-specific values.
Diffstat (limited to 'gnu/classpath/debug/SystemLogger.java')
-rw-r--r--gnu/classpath/debug/SystemLogger.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/gnu/classpath/debug/SystemLogger.java b/gnu/classpath/debug/SystemLogger.java
new file mode 100644
index 000000000..94aa93f69
--- /dev/null
+++ b/gnu/classpath/debug/SystemLogger.java
@@ -0,0 +1,71 @@
+/* SystemLogger.java -- Classpath's system debugging logger.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under terms
+of your choice, provided that you also meet, for each linked independent
+module, the terms and conditions of the license of that module. An
+independent module is a module which is not derived from or based on
+this library. If you modify this library, you may extend this exception
+to your version of the library, but you are not obligated to do so. If
+you do not wish to do so, delete this exception statement from your
+version. */
+
+
+package gnu.classpath.debug;
+
+import gnu.classpath.SystemProperties;
+import java.util.StringTokenizer;
+import java.util.logging.Logger;
+
+public final class SystemLogger
+{
+ public static final Logger SYSTEM = Logger.getLogger ("gnu.classpath");
+
+ static
+ {
+ SYSTEM.setFilter (PreciseFilter.GLOBAL);
+
+ String defaults = SystemProperties.getProperty ("gnu.classpath.debug.components");
+
+ if (defaults != null)
+ {
+ StringTokenizer tok = new StringTokenizer (defaults, ",");
+ while (tok.hasMoreTokens ())
+ {
+ Component c = Component.forName (tok.nextToken ());
+ if (c != null)
+ PreciseFilter.GLOBAL.enable (c);
+ SYSTEM.log (java.util.logging.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]);
+ }
+}