au.id.jericho.lib.html
Class WriterLogger
java.lang.Object
au.id.jericho.lib.html.WriterLogger
- Logger
public class WriterLogger
extends java.lang.Object
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.
WriterLogger(Writer writer) - Constructs a new
WriterLogger with the specified Writer and the default name.
|
WriterLogger(Writer writer, String name) - Constructs a new
WriterLogger with the specified Writer and name.
|
WriterLogger
public WriterLogger(Writer writer)
Constructs a new
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.
WriterLogger
public WriterLogger(Writer writer,
String name)
Constructs a new
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
.
debug
public void debug(String message)
- debug in interface Logger
error
public void error(String message)
- error in interface Logger
getName
public String getName()
Returns the name of this logger.
- the name of this logger, may be
null
.
getWriter
public Writer getWriter()
Returns the Writer
to which all output is sent.
- the
Writer
to which all output is sent.
info
public void info(String message)
- info in interface Logger
setDebugEnabled
public void setDebugEnabled(boolean debugEnabled)
Sets whether logging is enabled at the DEBUG level.
debugEnabled
- determines whether logging is enabled at the DEBUG level.
setErrorEnabled
public void setErrorEnabled(boolean errorEnabled)
Sets whether logging is enabled at the ERROR level.
errorEnabled
- determines whether logging is enabled at the ERROR level.
setInfoEnabled
public void setInfoEnabled(boolean infoEnabled)
Sets whether logging is enabled at the INFO level.
infoEnabled
- determines whether logging is enabled at the INFO level.
setWarnEnabled
public void setWarnEnabled(boolean warnEnabled)
Sets whether logging is enabled at the WARN level.
warnEnabled
- determines whether logging is enabled at the WARN level.
warn
public void warn(String message)
- warn in interface Logger