|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.util.AbstractLogFile
Abstract base class which implements most of the LogTarget interface, to make it easier to write new log targets that plug into WM.
Field Summary | |
protected java.lang.String |
_defaultFormatString
|
protected int |
_defaultLevel
|
protected java.lang.String |
_formatString
|
protected java.util.Map |
_levels
|
protected java.text.MessageFormat |
_mf
|
protected java.lang.String |
_name
|
protected java.util.List |
_observers
|
protected boolean |
_trace
|
Constructor Summary | |
AbstractLogFile()
|
|
AbstractLogFile(Settings s)
Create a new LogFile instance reading properties from the supplied Settings object. |
Method Summary | |
void |
addObserver(LogSystem ls)
A LogSystem will register itself though this method in order to detect changes to the LogTarget. |
void |
removeObserver(LogSystem ls)
A LogSystem may remove itself through this method if it de-registeres the LogTarget. |
void |
setLogLevel(int level)
Set the log level for this Logfile. |
void |
setLogLevel(java.lang.String name,
int level)
Set the log level for a specific category name. |
void |
setTraceExceptions(boolean trace)
Set whether this LogFile traces exceptions. |
boolean |
subscribe(java.lang.String category,
java.lang.String name,
int level)
Return true or false if this log target would like to receive log messages for the named category, type, and logLevel. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.webmacro.util.LogTarget |
flush, log |
Field Detail |
protected java.util.Map _levels
protected boolean _trace
protected int _defaultLevel
protected java.lang.String _defaultFormatString
protected java.lang.String _formatString
protected java.text.MessageFormat _mf
protected java.util.List _observers
protected java.lang.String _name
Constructor Detail |
public AbstractLogFile(Settings s)
Create a new LogFile instance reading properties from the supplied Settings object.
LogTraceExceptions: true|false|yes|no|on|off LogLevel: Debug|Info|Notice|etc
public AbstractLogFile()
Method Detail |
public java.lang.String toString()
public void setLogLevel(int level)
public void setLogLevel(java.lang.String name, int level)
public void setTraceExceptions(boolean trace)
public boolean subscribe(java.lang.String category, java.lang.String name, int level)
LogTarget
The logLevel you will be called with is one of the integers Log.ALL, Log.DEBUG, Log.INFO, Log.NOTICE, Log.WARNING, Log.ERROR, and Log.NONE in ascending order (Log.ERROR is a higher number than Log.WARNING which is a higher number than Log.DEBUG). In other words, the higher the logLevel the more important the log message is.
subscribe
in interface LogTarget
public void addObserver(LogSystem ls)
LogTarget
addObserver
in interface LogTarget
public void removeObserver(LogSystem ls)
LogTarget
removeObserver
in interface LogTarget
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |