Class ConsoleHandler
java.lang.Object
java.util.logging.Handler
org.jboss.logmanager.ExtHandler
org.jboss.logmanager.handlers.WriterHandler
org.jboss.logmanager.handlers.OutputStreamHandler
org.jboss.logmanager.handlers.ConsoleHandler
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, FlushableCloseable, Protectable
A console handler which writes to
System.out by default.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PrintWriterprivate static final OutputStreamprivate static final OutputStreamFields inherited from class WriterHandler
outputLockFields inherited from class ExtHandler
handlers, handlersUpdater -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance.ConsoleHandler(Formatter formatter) Construct a new instance.ConsoleHandler(ConsoleHandler.Target target) Construct a new instance.ConsoleHandler(ConsoleHandler.Target target, Formatter formatter) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetOutputStream(OutputStream outputStream) Set the output stream to write to.voidsetTarget(ConsoleHandler.Target target) Set the target for this console handler.private static OutputStreamwrap(OutputStream outputStream) private static WriterMethods inherited from class OutputStreamHandler
getEncoding, setEncoding, setWriterMethods inherited from class ExtHandler
addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotectMethods inherited from class Handler
getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError
-
Field Details
-
out
-
err
-
console
-
-
Constructor Details
-
ConsoleHandler
public ConsoleHandler()Construct a new instance. -
ConsoleHandler
Construct a new instance.- Parameters:
formatter- the formatter to use
-
ConsoleHandler
Construct a new instance.- Parameters:
target- the target to write to, ornullto start with an uninitialized target
-
ConsoleHandler
Construct a new instance.- Parameters:
target- the target to write to, ornullto start with an uninitialized targetformatter- the formatter to use
-
-
Method Details
-
setTarget
Set the target for this console handler.- Parameters:
target- the target to write to, ornullto clear the target
-
wrap
-
wrap
-
setOutputStream
Set the output stream to write to.- Overrides:
setOutputStreamin classOutputStreamHandler- Parameters:
outputStream- the new output stream ornullfor none
-