java.io.Closeable
, java.io.Flushable
, java.lang.AutoCloseable
, FlushableCloseable
, Protectable
public class ConsoleHandler extends OutputStreamHandler
System.out
by default.Modifier and Type | Class | Description |
---|---|---|
static class |
ConsoleHandler.Target |
The target stream type.
|
handlers, handlersUpdater
outputLock
Constructor | Description |
---|---|
ConsoleHandler() |
Construct a new instance.
|
ConsoleHandler(java.util.logging.Formatter formatter) |
Construct a new instance.
|
ConsoleHandler(ConsoleHandler.Target target) |
Construct a new instance.
|
ConsoleHandler(ConsoleHandler.Target target,
java.util.logging.Formatter formatter) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
void |
setOutputStream(java.io.OutputStream outputStream) |
Set the output stream to write to.
|
void |
setTarget(ConsoleHandler.Target target) |
Set the target for this console handler.
|
addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect
getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEncoding, setEncoding, setWriter
public ConsoleHandler()
public ConsoleHandler(java.util.logging.Formatter formatter)
formatter
- the formatter to usepublic ConsoleHandler(ConsoleHandler.Target target)
target
- the target to write to, or null
to start with an uninitialized targetpublic ConsoleHandler(ConsoleHandler.Target target, java.util.logging.Formatter formatter)
target
- the target to write to, or null
to start with an uninitialized targetformatter
- the formatter to usepublic void setTarget(ConsoleHandler.Target target)
target
- the target to write to, or null
to clear the targetpublic void setOutputStream(java.io.OutputStream outputStream)
setOutputStream
in class OutputStreamHandler
outputStream
- the new output stream or null
for noneCopyright © 2018. All rights reserved.