|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlazyj.Log
public final class Log
Logging facility. Provides package- and class-based logging level and destination folder.
| Field Summary | |
|---|---|
static int |
ERROR
Constant for the ERROR log level |
static int |
FATAL
Constant for the FATAL log level |
static int |
FINE
Constant for the FINE log level |
static int |
FINER
Constant for the FINER log level |
static int |
FINEST
Constant for the FINEST log level |
static int |
INFO
Constant for the INFO log level |
static int |
WARNING
Constant for the WARNING log level |
| Constructor Summary | |
|---|---|
Log()
|
|
| Method Summary | |
|---|---|
static java.lang.Integer |
getLevel(java.lang.String sComponent)
Get the current logging level for a component |
static java.lang.String |
getLogDir(java.lang.String sComponent)
For a given component, get the folder where the log files should be put. |
static boolean |
isLoggable(int level,
java.lang.String sComponent)
Check if a message of a given level for a given component will be actually logged. |
static void |
log(int level,
java.lang.String sComponent,
java.lang.String sMessage)
Log a message of a given severity for a given component |
static void |
log(int level,
java.lang.String sComponent,
java.lang.String sMessage,
java.lang.Object o)
Log a message of a given severity for a given component, with an attached object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FATAL
public static final int ERROR
public static final int WARNING
public static final int INFO
public static final int FINE
public static final int FINER
public static final int FINEST
| Constructor Detail |
|---|
public Log()
| Method Detail |
|---|
public static java.lang.Integer getLevel(java.lang.String sComponent)
sComponent - component to get the level for
public static java.lang.String getLogDir(java.lang.String sComponent)
sComponent - component (class hierarchy)
public static boolean isLoggable(int level,
java.lang.String sComponent)
if (Log.isLoggable(Log.DEBUG, "class.name")){
Log.log(Log.DEBUG, "class.name", "Some complicated message here : "+object.toString());
}
level - desired logging levelsComponent - component
public static void log(int level,
java.lang.String sComponent,
java.lang.String sMessage)
level - severity of the message. Check the constants in this class for possible values.sComponent - component name. Usually "servlet_zone/servlet_name", but could be the class name or something else you wantsMessage - message to log
public static void log(int level,
java.lang.String sComponent,
java.lang.String sMessage,
java.lang.Object o)
level - severity of the message. Check the constants in this class for possible values.sComponent - component name. Usually "servlet_zone/servlet_name", but could be the class name or something else you wantsMessage - message to logo - object to attach, it is intended for use with a Throwable here, but works for any other objects too by invoking the .toString() method on them
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||