|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.util.LogSystem
The LogSystem class allows you to create and manage log objects and log targets. The LogSystem takes responsibility for ensuring that the appropriate targets are connected to the appropriate log objects.
There is a global LogSystem in place which you can access by calling getInstance(). Alternately you can create a new Logsystem by calling getInstance(category). Each category is a singleton with only one instance corresponding to its name existing in the JVM at any given time.
Field Summary | |
static int |
ALL
|
static int |
DEBUG
|
static int |
ERROR
|
static int |
INFO
|
protected static java.lang.String[] |
LEVELS
Mapping of numbers to names. |
static int |
NONE
|
static int |
NOTICE
|
static int |
WARNING
|
Method Summary | |
void |
addTarget(LogTarget t)
Add a new LogTarget to the LogSystem. |
void |
flush()
Flush all of the LogTarget objects in the system |
static void |
flushAll()
Flush all log systems |
static LogSystem |
getInstance()
Get the global, system-wide, default log system |
static LogSystem |
getInstance(java.lang.String category)
Return the log-system with the specified category |
static int |
getLevel(java.lang.String levelName)
Convert a string like "DEBUG" into a level number. |
Log |
getLog(java.lang.String type)
Get an instance of a Log object for the specified type. |
Log |
getLog(java.lang.String type,
java.lang.String description)
Get the Log object within this LogSystem that has the specified Log type. |
static Log |
getSystemLog(java.lang.String type)
Get a system-wide log |
static Log |
getSystemLog(java.lang.String type,
java.lang.String description)
Get a system log, providing it with a description of itself |
static void |
main(java.lang.String[] arg)
Test out the logging system |
void |
removeTarget(LogTarget t)
Remove a LogTarget from the LogSystem. |
void |
update(LogTarget target,
java.lang.String type)
LogTarget should call this method to notify LogSystem that conditions have changed and that the subscribe() method on LogTarget may now return a different value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALL
public static final int DEBUG
public static final int INFO
public static final int NOTICE
public static final int WARNING
public static final int ERROR
public static final int NONE
protected static final java.lang.String[] LEVELS
Method Detail |
public static int getLevel(java.lang.String levelName)
public static LogSystem getInstance()
public static Log getSystemLog(java.lang.String type)
public static Log getSystemLog(java.lang.String type, java.lang.String description)
public static LogSystem getInstance(java.lang.String category)
public Log getLog(java.lang.String type)
public Log getLog(java.lang.String type, java.lang.String description)
public void addTarget(LogTarget t)
public void removeTarget(LogTarget t)
public void update(LogTarget target, java.lang.String type)
public void flush()
public static void flushAll()
public static void main(java.lang.String[] arg) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |