FileDocCategorySizeDatePackage
ClassLogger.javaAPI DocJava SE 6 API5878Tue Jun 10 00:22:04 BST 2008com.sun.jmx.remote.util

ClassLogger

public class ClassLogger extends Object

Fields Summary
private static final boolean
ok
private final String
className
private final Logger
logger
Constructors Summary
public ClassLogger(String subsystem, String className)

	/* We attempt to work even if we are running in J2SE 1.3, where
	   there is no java.util.logging.  The technique we use here is
	   not strictly portable, but it does work with Sun's J2SE 1.3
	   at least.  This is just a best effort: the Right Thing is for
	   people to use at least J2SE 1.4.  */
	boolean loaded = false;
	try {
	    Class c = java.util.logging.Logger.class;
	    loaded = true;
	} catch (Error e) {
	    // OK.
	    // java.util.logger package is not available in this jvm.
	}
	ok = loaded;
    
	if (ok)
	    logger = Logger.getLogger(subsystem);
	else
	    logger = null;
	this.className = className;
    
Methods Summary
public final voidconfig(java.lang.String func, java.lang.String msg)

	if (ok)
	    logger.logp(java.util.logging.Level.CONFIG, className, func, msg);
    
public final voidconfig(java.lang.String func, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.CONFIG, className, func,
			t.toString(), t);
    
public final voidconfig(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.CONFIG, className, func, msg,
			t);
    
public final booleanconfigOn()

	return ok && logger.isLoggable(java.util.logging.Level.CONFIG);
    
public final voiddebug(java.lang.String func, java.lang.String msg)

	finest(func,msg);
    
public final voiddebug(java.lang.String func, java.lang.Throwable t)

	finest(func,t);
    
public final voiddebug(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	finest(func,msg,t);
    
public final booleandebugOn()

	return finestOn();
    
public final voiderror(java.lang.String func, java.lang.String msg)

	severe(func,msg);
    
public final voiderror(java.lang.String func, java.lang.Throwable t)

	severe(func,t);
    
public final voiderror(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	severe(func,msg,t);
    
public final voidfine(java.lang.String func, java.lang.String msg)

	if (ok)
	    logger.logp(java.util.logging.Level.FINE, className, func, msg);
    
public final voidfine(java.lang.String func, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.FINE, className, func,
			t.toString(), t);
    
public final voidfine(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.FINE, className, func, msg,
			t);
    
public final booleanfineOn()

	return ok && logger.isLoggable(java.util.logging.Level.FINE);
    
public final voidfiner(java.lang.String func, java.lang.String msg)

	if (ok)
	    logger.logp(java.util.logging.Level.FINER, className, func, msg);
    
public final voidfiner(java.lang.String func, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.FINER, className, func,
			t.toString(), t);
    
public final voidfiner(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.FINER, className, func, msg,t);
    
public final booleanfinerOn()

	return ok && logger.isLoggable(java.util.logging.Level.FINER);
    
public final voidfinest(java.lang.String func, java.lang.String msg)

	if (ok)
	    logger.logp(java.util.logging.Level.FINEST, className, func, msg);
    
public final voidfinest(java.lang.String func, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.FINEST, className, func,
			t.toString(), t);
    
public final voidfinest(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.FINEST, className, func, msg,
			t);
    
public final booleanfinestOn()

	return ok && logger.isLoggable(java.util.logging.Level.FINEST);
    
public final voidinfo(java.lang.String func, java.lang.String msg)

	if (ok)
	    logger.logp(java.util.logging.Level.INFO, className, func, msg);
    
public final voidinfo(java.lang.String func, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.INFO, className, func,
			t.toString(), t);
    
public final voidinfo(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.INFO, className, func, msg,
			t);
    
public final booleaninfoOn()

	return ok && logger.isLoggable(java.util.logging.Level.INFO);
    
public final voidsevere(java.lang.String func, java.lang.String msg)

	if (ok)
	    logger.logp(java.util.logging.Level.SEVERE, className, func, msg);
    
public final voidsevere(java.lang.String func, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.SEVERE, className, func,
			t.toString(), t);
    
public final voidsevere(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.SEVERE, className, func, msg,
			t);
    
public final voidtrace(java.lang.String func, java.lang.String msg)

	finer(func,msg);
    
public final voidtrace(java.lang.String func, java.lang.Throwable t)

	finer(func,t);
    
public final voidtrace(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	finer(func,msg,t);
    
public final booleantraceOn()

	return finerOn();
    
public final voidwarning(java.lang.String func, java.lang.String msg)

	if (ok)
	    logger.logp(java.util.logging.Level.WARNING, className, func, msg);
    
public final voidwarning(java.lang.String func, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.WARNING, className, func,
			t.toString(), t);
    
public final voidwarning(java.lang.String func, java.lang.String msg, java.lang.Throwable t)

	if (ok)
	    logger.logp(java.util.logging.Level.WARNING, className, func, msg,
			t);
    
public final booleanwarningOn()

	return ok && logger.isLoggable(java.util.logging.Level.WARNING);