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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
flush()
Get the delegate handler.getLevel()
boolean
isLoggable
(LogRecord record) void
void
setEncoding
(String encoding) void
void
setFormatter
(Formatter newFormatter) void
setHandler
(StreamHandler handler) Set the handler.void
Methods inherited from class java.util.logging.StreamHandler
setOutputStream
Methods 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:
publish
in classStreamHandler
-
close
- Overrides:
close
in classStreamHandler
- Throws:
SecurityException
-
setEncoding
public void setEncoding(@Nullable String encoding) throws SecurityException, UnsupportedEncodingException - Overrides:
setEncoding
in classStreamHandler
- Throws:
SecurityException
UnsupportedEncodingException
-
isLoggable
- Overrides:
isLoggable
in classStreamHandler
-
flush
public void flush()- Overrides:
flush
in classStreamHandler
-
setFormatter
- Overrides:
setFormatter
in classHandler
- Throws:
SecurityException
-
getFormatter
- Overrides:
getFormatter
in classHandler
-
getEncoding
- Overrides:
getEncoding
in classHandler
-
setFilter
- Overrides:
setFilter
in classHandler
- Throws:
SecurityException
-
getFilter
-
setLevel
- Overrides:
setLevel
in classHandler
- Throws:
SecurityException
-
getLevel
-