diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-12-10 20:25:39 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-12-10 20:25:39 +0000 |
commit | da66af5951b18b6f5e8752cbbe11f5f842332a33 (patch) | |
tree | a28e126d1415e3689be6c7b2c2d061ae51194195 /gnu/classpath | |
parent | ab90923ee693a17e2e0e37b6ba5a84794c9236de (diff) | |
download | classpath-da66af5951b18b6f5e8752cbbe11f5f842332a33.tar.gz |
2006-12-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of generics-branch to HEAD (woohoo!)
Diffstat (limited to 'gnu/classpath')
-rw-r--r-- | gnu/classpath/SystemProperties.java | 1 | ||||
-rw-r--r-- | gnu/classpath/debug/Component.java | 7 | ||||
-rw-r--r-- | gnu/classpath/debug/SystemLogger.java | 41 |
3 files changed, 42 insertions, 7 deletions
diff --git a/gnu/classpath/SystemProperties.java b/gnu/classpath/SystemProperties.java index 991279eab..d091f1ed0 100644 --- a/gnu/classpath/SystemProperties.java +++ b/gnu/classpath/SystemProperties.java @@ -169,4 +169,5 @@ public class SystemProperties { return (String) properties.remove(name); } + } diff --git a/gnu/classpath/debug/Component.java b/gnu/classpath/debug/Component.java index 0cc38d709..dce257502 100644 --- a/gnu/classpath/debug/Component.java +++ b/gnu/classpath/debug/Component.java @@ -97,8 +97,13 @@ public final class Component extends Level * Trace details about the SSL key exchange. */ public static final Component SSL_KEY_EXCHANGE = new Component ("SSL KEY EXCHANGE", 2); + + /** + * Trace running of delegated tasks. + */ + public static final Component SSL_DELEGATED_TASK = new Component ("SSL DELEGATED TASK", 3); - /* Indices 3 and 4 reserved for future use by SSL components. */ + /* Index 4 reserved for future use by SSL components. */ /** * Trace the operation of cryptographic primitives. diff --git a/gnu/classpath/debug/SystemLogger.java b/gnu/classpath/debug/SystemLogger.java index 502b48870..8919e80c7 100644 --- a/gnu/classpath/debug/SystemLogger.java +++ b/gnu/classpath/debug/SystemLogger.java @@ -42,11 +42,12 @@ import gnu.java.security.action.GetPropertyAction; import java.security.AccessController; 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 { @@ -62,12 +63,40 @@ public final class SystemLogger 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]); + /** + * Fetch the system logger instance. The logger returned is meant for debug + * and diagnostic logging for Classpath internals. + * + * @return The system logger. + */ + public static SystemLogger getSystemLogger() + { + // XXX Check some permission here? + return SYSTEM; + } + + /** + * 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); } } |