|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.connectivity.oda.util.logging.Handler
org.eclipse.datatools.connectivity.oda.util.logging.StreamHandler
public class StreamHandler
StreamHandler
is a stream based logging
Handler
.
Constructor Summary | |
---|---|
StreamHandler()
Creates a StreamHandler with no output stream. |
|
StreamHandler(java.io.OutputStream output,
LogFormatter formatter)
Creates a StreamHandler with the specified output
stream and LogFormatter . |
Method Summary | |
---|---|
void |
close()
Closes the current output stream. |
void |
flush()
Flushes buffered message to the output stream. |
boolean |
isLoggable(LogRecord record)
Checks if this StreamHandler has an associated
OutputStream , whether the LogRecord has the
adequate log level, and whether it satisfies the associated Filter . |
void |
publish(LogRecord record)
Format and publish the specified LogRecord . |
void |
setFormatter(LogFormatter formatter)
Sets the LogFormatter for this StreamHandler . |
Methods inherited from class org.eclipse.datatools.connectivity.oda.util.logging.Handler |
---|
getFilter, getFormatter, getLevel, getLoggingErrorHandler, setFilter, setLevel, setLoggingErrorHandler |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamHandler()
StreamHandler
with no output stream.
public StreamHandler(java.io.OutputStream output, LogFormatter formatter)
StreamHandler
with the specified output
stream and LogFormatter
.
output
- the output stream.formatter
- the log formatter.Method Detail |
---|
public void close()
close
in class Handler
public void flush()
flush
in class Handler
public void publish(LogRecord record)
LogRecord
. This first checks
that there is an associated OutputStream
and the specified
LogRecord
has the required log level. This also checks the
LogRecord
with the associated Filter
to see if
the record should be published. Then this uses its LogFormatter
to format the record and publishes the result to the OutputStream
.
publish
in class Handler
record
- the LogRecord
to format and publish.public boolean isLoggable(LogRecord record)
StreamHandler
has an associated
OutputStream
, whether the LogRecord
has the
adequate log level, and whether it satisfies the associated Filter
.
isLoggable
in class Handler
record
- the LogRecord
to check.
LogRecord
should be logged.public void setFormatter(LogFormatter formatter)
LogFormatter
for this StreamHandler
.
If the formatter is null
, then default SimpleFormatter
will be used.
setFormatter
in class Handler
formatter
- the formatter to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |