Package com.sk89q.worldedit.util.logging
Class DynamicStreamHandler
java.lang.Object
java.util.logging.Handler
java.util.logging.StreamHandler
com.sk89q.worldedit.util.logging.DynamicStreamHandler
A
StreamHandler delegate that allows for the swap and disable of
another handler. When setHandler(StreamHandler) is called with
null, then records passed onto this handler will be dropped. Otherwise,
the delegate handler will receive those records.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Get the delegate handler.getLevel()booleanisLoggable(LogRecord record) voidvoidsetEncoding(String encoding) voidvoidsetFormatter(Formatter newFormatter) voidsetHandler(StreamHandler handler) Set the handler.voidMethods inherited from class java.util.logging.StreamHandler
setOutputStreamMethods inherited from class java.util.logging.Handler
getErrorManager, reportError, setErrorManager
-
Constructor Details
-
DynamicStreamHandler
public DynamicStreamHandler()
-
-
Method Details
-
getHandler
Get the delegate handler.- Returns:
- the delegate handler (Which may be null)
-
setHandler
Set the handler.- Parameters:
handler- the delegate handler (which can be null)
-
publish
- Overrides:
publishin classStreamHandler
-
close
- Overrides:
closein classStreamHandler- Throws:
SecurityException
-
setEncoding
public void setEncoding(@Nullable String encoding) throws SecurityException, UnsupportedEncodingException - Overrides:
setEncodingin classStreamHandler- Throws:
SecurityExceptionUnsupportedEncodingException
-
isLoggable
- Overrides:
isLoggablein classStreamHandler
-
flush
public void flush()- Overrides:
flushin classStreamHandler
-
setFormatter
- Overrides:
setFormatterin classHandler- Throws:
SecurityException
-
getFormatter
- Overrides:
getFormatterin classHandler
-
getEncoding
- Overrides:
getEncodingin classHandler
-
setFilter
- Overrides:
setFilterin classHandler- Throws:
SecurityException
-
getFilter
-
setLevel
- Overrides:
setLevelin classHandler- Throws:
SecurityException
-
getLevel
-