|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWriterLogger
public class WriterLogger
Provides an implementation of the Logger
interface that sends output to the specified java.io.Writer
.
Each log entry is formatted using the BasicLogFormatter.format(String level, String message, String loggerName)
method.
Note that each logging level can be enabled independently in this implementation.
Constructor Summary | |
---|---|
WriterLogger(java.io.Writer writer)
Constructs a new WriterLogger with the specified Writer and the default name. |
|
WriterLogger(java.io.Writer writer,
java.lang.String name)
Constructs a new WriterLogger with the specified Writer and name. |
Method Summary | |
---|---|
void |
debug(java.lang.String message)
Logs a message at the DEBUG level. |
void |
error(java.lang.String message)
Logs a message at the ERROR level. |
java.lang.String |
getName()
Returns the name of this logger. |
java.io.Writer |
getWriter()
Returns the Writer to which all output is sent. |
void |
info(java.lang.String message)
Logs a message at the INFO level. |
boolean |
isDebugEnabled()
Indicates whether logging is enabled at the DEBUG level. |
boolean |
isErrorEnabled()
Indicates whether logging is enabled at the ERROR level. |
boolean |
isInfoEnabled()
Indicates whether logging is enabled at the INFO level. |
boolean |
isWarnEnabled()
Indicates whether logging is enabled at the WARN level. |
void |
setDebugEnabled(boolean debugEnabled)
Sets whether logging is enabled at the DEBUG level. |
void |
setErrorEnabled(boolean errorEnabled)
Sets whether logging is enabled at the ERROR level. |
void |
setInfoEnabled(boolean infoEnabled)
Sets whether logging is enabled at the INFO level. |
void |
setWarnEnabled(boolean warnEnabled)
Sets whether logging is enabled at the WARN level. |
void |
warn(java.lang.String message)
Logs a message at the WARN level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WriterLogger(java.io.Writer writer)
WriterLogger
with the specified Writer
and the default name.
The default logger name is "net.htmlparser.jericho
".
writer
- the Writer
to which all output is sent.public WriterLogger(java.io.Writer writer, java.lang.String name)
WriterLogger
with the specified Writer
and name.
The value of the name
argument is only relevant if the BasicLogFormatter.OutputName
static property is set to true
,
otherwise the name is not included in the output at all.
writer
- the Writer
to which all output is sent.name
- the logger name, may be null
.Method Detail |
---|
public java.io.Writer getWriter()
Writer
to which all output is sent.
Writer
to which all output is sent.public java.lang.String getName()
null
.public void error(java.lang.String message)
Logger
error
in interface Logger
message
- the message to log.public void warn(java.lang.String message)
Logger
warn
in interface Logger
message
- the message to log.public void info(java.lang.String message)
Logger
info
in interface Logger
message
- the message to log.public void debug(java.lang.String message)
Logger
debug
in interface Logger
message
- the message to log.public boolean isErrorEnabled()
Logger
isErrorEnabled
in interface Logger
true
if logging is enabled at the ERROR level, otherwise false
.public void setErrorEnabled(boolean errorEnabled)
errorEnabled
- determines whether logging is enabled at the ERROR level.public boolean isWarnEnabled()
Logger
isWarnEnabled
in interface Logger
true
if logging is enabled at the WARN level, otherwise false
.public void setWarnEnabled(boolean warnEnabled)
warnEnabled
- determines whether logging is enabled at the WARN level.public boolean isInfoEnabled()
Logger
isInfoEnabled
in interface Logger
true
if logging is enabled at the INFO level, otherwise false
.public void setInfoEnabled(boolean infoEnabled)
infoEnabled
- determines whether logging is enabled at the INFO level.public boolean isDebugEnabled()
Logger
isDebugEnabled
in interface Logger
true
if logging is enabled at the DEBUG level, otherwise false
.public void setDebugEnabled(boolean debugEnabled)
debugEnabled
- determines whether logging is enabled at the DEBUG level.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |