|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crosswire.common.util.Logger
public final class Logger
This class is very similar to Commons-Logging except it should be even smaller and have an API closer to the Log4J API (and even J2SE 1.4 logging). This implementation is lazy. The actual internal logger is not initialized until first use. Turns out that this class indirectly depends upon JSword's Project class to help find the logging configuration file. If it is not lazy, it looks in the wrong places for the configuration file.
for license details.
The copyright to this program is held by it's authors.| Field Summary | |
|---|---|
private static String |
CLASS_NAME
|
private static Logger |
cwLogger
|
private static boolean |
established
|
private static Level |
level
|
private Logger |
logger
The actual logger. |
private static String |
ROOT_LOGGER
|
private boolean |
showLocation
Whether we dig into the call stack to get the method and line number of the caller. |
| Constructor Summary | |
|---|---|
private |
Logger(Class<T> id,
boolean showLocation)
Create a logger for the class. |
| Method Summary | ||
|---|---|---|
void |
debug(String msg)
Log a message object with the FINEST level. |
|
private void |
doLogging(Level theLevel,
String message,
Throwable th)
|
|
void |
error(String msg)
Log a message object with the WARNING level. |
|
void |
error(String msg,
Throwable th)
Log a message object with the WARNING level. |
|
private static void |
establishLogging()
|
|
void |
fatal(String msg)
Log a message object with the SEVERE level. |
|
void |
fatal(String msg,
Throwable th)
Log a message object with the SEVERE level. |
|
static
|
getLogger(Class<T> clazz)
Get a new logger for the class that shows the class, method and line number of the caller. |
|
static
|
getLogger(Class<T> clazz,
boolean showLocation)
Get a new logger for the class that shows the class of the caller. |
|
void |
info(String msg)
Log a message object with the INFO level. |
|
void |
info(String msg,
Throwable th)
Log a message object with the INFO level. |
|
private void |
initialize()
|
|
void |
log(Level lev,
String msg)
Log a message with the supplied level. |
|
void |
log(Level lev,
String msg,
Throwable th)
Log a message with the supplied level, recording the exception when not null. |
|
static void |
outputEverything()
Output everything |
|
static void |
outputInfoMinimum()
Output a minimum of stuff |
|
static void |
outputNothing()
Stop all logging output |
|
private static void |
setLevel()
|
|
void |
setLevel(Level newLevel)
Set the level at which output occurs for this Logger. |
|
void |
warn(String msg)
Log a message object with the FINE level. |
|
void |
warn(String msg,
Throwable th)
Log a message object with the FINE level. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String ROOT_LOGGER
private static final String CLASS_NAME
private static volatile boolean established
private static volatile Level level
private Logger logger
private static Logger cwLogger
private boolean showLocation
| Constructor Detail |
|---|
private Logger(Class<T> id,
boolean showLocation)
#java.util.logging.Logger.getLogger(String).
| Method Detail |
|---|
public static <T> Logger getLogger(Class<T> clazz)
clazz - the class that holds the logger.
public static <T> Logger getLogger(Class<T> clazz,
boolean showLocation)
clazz - the class that holds the logger.showLocation - when true it will get the method and line where logging occurred.public void setLevel(Level newLevel)
newLevel - the level to applypublic static void outputNothing()
public static void outputInfoMinimum()
public static void outputEverything()
public void fatal(String msg)
msg - the message to log.
public void fatal(String msg,
Throwable th)
msg - the message object to log.public void error(String msg)
msg - the message to log.
public void error(String msg,
Throwable th)
msg - the message to log.th - the exception to note when not nullpublic void info(String msg)
msg - the message object to log.
public void info(String msg,
Throwable th)
msg - the message object to log.th - the exception to note when not nullpublic void warn(String msg)
msg - the message object to log.
public void warn(String msg,
Throwable th)
msg - the message object to log.th - the exception to note when not nullpublic void debug(String msg)
msg - the message object to log.
public void log(Level lev,
String msg)
lev - the level at which to log.msg - the message to log.
public void log(Level lev,
String msg,
Throwable th)
msg - the message object to log.
private void doLogging(Level theLevel,
String message,
Throwable th)
private void initialize()
private static void establishLogging()
private static void setLevel()
|
Copyright ? 2003-2011 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||