|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lsst.ccs.utilities.logging.Logger
public class Logger
Just a wrapper class around java.util.Logger to add
specific logging methods.
The instances are not cached (so better have only one per package)
Most methods allow "multi-dimensional" logging (log the same data to various loggers).
Many of those are intended to replace log4j invocations by just changing the import directives.
The mapping from log4J Levels is operated this way
finest -> finest trace -> finer debug-> fine info -> info warn -> warning error -> severe fatal -> severe
| Method Summary | |
|---|---|
LogRecord |
createLogRecord(Level level,
String message)
creates a simple log record. |
boolean |
debug(Object message,
String... concerns)
logs a message at FINE Level |
void |
debug(Object message,
Throwable throwable,
String... concerns)
logs a message at FINE Level |
void |
error(Object message,
String... concerns)
logs a message at SEVERE Level (use preferably the error method that uses a Throwable parameter) |
void |
error(Object message,
Throwable throwable,
String... concerns)
logs a message at SEVERE Level |
void |
fatal(Object message,
String... concerns)
logs a message at SEVERE Level (use preferably the fatal method that uses a Throwable parameter) |
void |
fatal(Object message,
Throwable throwable,
String... concerns)
logs a message at SEVERE Level |
boolean |
fine(Object message,
String... concerns)
logs a message at FINE Level |
boolean |
finer(Object message,
String... concerns)
logs a message at FINER level |
boolean |
finest(Object message,
String... concerns)
logs a message at FINEST level |
Level |
getLevel()
|
static Logger |
getLogger(String name)
factory method to obtain a Logger proxy. |
static Logger |
getLogger(String name,
String resourceBundleName)
factory method to obtain a Logger proxy. |
String |
getName()
|
boolean |
info(Object message,
String... concerns)
logs a message at INFO Level |
void |
info(Object message,
Throwable throwable,
String... concerns)
logs a message at INFO Level |
boolean |
isDebugEnabled()
tells if the FINE level is activated for the corresponding JUL Logger. |
boolean |
isInfoEnabled()
tells if the INFO level is activated for the corresponding JUL Logger. |
boolean |
isLoggable(Level level)
tells if the corresponding JUL level is activated for the corresponding JUL Logger. |
boolean |
log(Level level,
String message,
Object[] arguments,
String... concerns)
does the same as the equivalent standard JUL method but forwards also to other Loggers. |
boolean |
log(Level level,
String message,
Object argument,
String... concerns)
does the same as the equivalent standard JUL method but forwards also to other Loggers. |
void |
log(Level level,
String message,
Throwable throwable,
String... concerns)
does the same as the equivalent standard JUL method but forwards also to other Loggers. |
void |
log(LogRecord record,
String... concerns)
utility method to send a LogRecord to the corresponding JUL logger and to a list of other loggers. |
protected boolean |
logMessage(Level level,
Object message,
String... concerns)
utility method to log a message with a Level |
protected void |
logSimpleThrowable(Level level,
Object message,
Throwable throwable,
String... concerns)
utility method to forward a Throwable and a message to the loggers. |
void |
severe(Object message,
String... concerns)
logs a message at SEVERE Level (use preferably the severe method that uses a Throwable parameter) |
void |
severe(Object message,
Throwable throwable,
String... concerns)
logs a message at SEVERE Level |
void |
throwing(String sourceClass,
String sourceMethod,
Throwable throwable)
invokes the throwing method on the corresponding JUL logger. |
boolean |
trace(Object message,
String... concerns)
logs a message at FINER level |
boolean |
warn(Object message,
String... concerns)
logs a message at WARNING Level |
void |
warn(Object message,
Throwable throwable,
String... concerns)
logs a message at WARNING Level |
boolean |
warning(Object message,
String... concerns)
logs a message at WARNING Level |
void |
warning(Object message,
Throwable throwable,
String... concerns)
logs a message at WARNING Level |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Logger getLogger(String name)
name - usually a package name (top of hierarchy is "" empty String)
public static Logger getLogger(String name,
String resourceBundleName)
name - usually a package name (top of hierarchy is "" empty String)resourceBundleName -
public String getName()
public Level getLevel()
public LogRecord createLogRecord(Level level,
String message)
level - JUL Levelmessage - (avoid null values)
protected boolean logMessage(Level level,
Object message,
String... concerns)
level - JUL levelmessage - (avoid null values)concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean finest(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean trace(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean finer(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean debug(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean fine(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean info(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean warn(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean warning(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void error(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void fatal(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void severe(Object message,
String... concerns)
message - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)public boolean isDebugEnabled()
public boolean isInfoEnabled()
protected void logSimpleThrowable(Level level,
Object message,
Throwable throwable,
String... concerns)
level - JUL levelmessage - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void fatal(Object message,
Throwable throwable,
String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void severe(Object message,
Throwable throwable,
String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void error(Object message,
Throwable throwable,
String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void warn(Object message,
Throwable throwable,
String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void warning(Object message,
Throwable throwable,
String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void throwing(String sourceClass,
String sourceMethod,
Throwable throwable)
sourceClass - sourceMethod - throwable -
public void info(Object message,
Throwable throwable,
String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void debug(Object message,
Throwable throwable,
String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)public boolean isLoggable(Level level)
public void log(LogRecord record,
String... concerns)
record - (should be created with the createLogRecord factory :otherwise stack information will be wrong)concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean log(Level level,
String message,
Object argument,
String... concerns)
level - JUL levelmessage - argument - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public boolean log(Level level,
String message,
Object[] arguments,
String... concerns)
level - JUL levelmessage - arguments - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
public void log(Level level,
String message,
Throwable throwable,
String... concerns)
level - JUL levelmessage - throwable - concerns - a list of additional JUL loggers name (such as "INIT", "CONFIG" ,...)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||