ClassLoggerpublic 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 void | config(java.lang.String func, java.lang.String msg)
if (ok)
logger.logp(java.util.logging.Level.CONFIG, className, func, msg);
| public final void | config(java.lang.String func, java.lang.Throwable t)
if (ok)
logger.logp(java.util.logging.Level.CONFIG, className, func,
t.toString(), t);
| public final void | config(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 boolean | configOn()
return ok && logger.isLoggable(java.util.logging.Level.CONFIG);
| public final void | debug(java.lang.String func, java.lang.String msg)
finest(func,msg);
| public final void | debug(java.lang.String func, java.lang.Throwable t)
finest(func,t);
| public final void | debug(java.lang.String func, java.lang.String msg, java.lang.Throwable t)
finest(func,msg,t);
| public final boolean | debugOn()
return finestOn();
| public final void | error(java.lang.String func, java.lang.String msg)
severe(func,msg);
| public final void | error(java.lang.String func, java.lang.Throwable t)
severe(func,t);
| public final void | error(java.lang.String func, java.lang.String msg, java.lang.Throwable t)
severe(func,msg,t);
| public final void | fine(java.lang.String func, java.lang.String msg)
if (ok)
logger.logp(java.util.logging.Level.FINE, className, func, msg);
| public final void | fine(java.lang.String func, java.lang.Throwable t)
if (ok)
logger.logp(java.util.logging.Level.FINE, className, func,
t.toString(), t);
| public final void | fine(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 boolean | fineOn()
return ok && logger.isLoggable(java.util.logging.Level.FINE);
| public final void | finer(java.lang.String func, java.lang.String msg)
if (ok)
logger.logp(java.util.logging.Level.FINER, className, func, msg);
| public final void | finer(java.lang.String func, java.lang.Throwable t)
if (ok)
logger.logp(java.util.logging.Level.FINER, className, func,
t.toString(), t);
| public final void | finer(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 boolean | finerOn()
return ok && logger.isLoggable(java.util.logging.Level.FINER);
| public final void | finest(java.lang.String func, java.lang.String msg)
if (ok)
logger.logp(java.util.logging.Level.FINEST, className, func, msg);
| public final void | finest(java.lang.String func, java.lang.Throwable t)
if (ok)
logger.logp(java.util.logging.Level.FINEST, className, func,
t.toString(), t);
| public final void | finest(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 boolean | finestOn()
return ok && logger.isLoggable(java.util.logging.Level.FINEST);
| public final void | info(java.lang.String func, java.lang.String msg)
if (ok)
logger.logp(java.util.logging.Level.INFO, className, func, msg);
| public final void | info(java.lang.String func, java.lang.Throwable t)
if (ok)
logger.logp(java.util.logging.Level.INFO, className, func,
t.toString(), t);
| public final void | info(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 boolean | infoOn()
return ok && logger.isLoggable(java.util.logging.Level.INFO);
| public final void | severe(java.lang.String func, java.lang.String msg)
if (ok)
logger.logp(java.util.logging.Level.SEVERE, className, func, msg);
| public final void | severe(java.lang.String func, java.lang.Throwable t)
if (ok)
logger.logp(java.util.logging.Level.SEVERE, className, func,
t.toString(), t);
| public final void | severe(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 void | trace(java.lang.String func, java.lang.String msg)
finer(func,msg);
| public final void | trace(java.lang.String func, java.lang.Throwable t)
finer(func,t);
| public final void | trace(java.lang.String func, java.lang.String msg, java.lang.Throwable t)
finer(func,msg,t);
| public final boolean | traceOn()
return finerOn();
| public final void | warning(java.lang.String func, java.lang.String msg)
if (ok)
logger.logp(java.util.logging.Level.WARNING, className, func, msg);
| public final void | warning(java.lang.String func, java.lang.Throwable t)
if (ok)
logger.logp(java.util.logging.Level.WARNING, className, func,
t.toString(), t);
| public final void | warning(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 boolean | warningOn()
return ok && logger.isLoggable(java.util.logging.Level.WARNING);
|
|