I have never been clear about Java handler and Android handler. Today I leave it empty. I have read the API and the source code, and I will write it at random.
The handler class in Java directly inherits from the object class. The JDK 1.6 API describes handler as follows:
Public abstract classHandlerExtends object
java.lang.Object java.util.logging.Handler
-
Directly known subclass:
-
Memoryhandler, streamhandler
HandlerObject slaveLoggerAnd export the log information. For example, it can write the information to the console or file, send the information to the Network Log service, or forward it to the operating system log.
RunSetlevel (level. Off)To disableHandlerAnd can be executed at the appropriate levelSetlevelTo re-enable.
HandlerClassLogmanagerAttribute to setHandlerOfFilter,FormatterAndLevel. For each specificHandlerClass, see the specified document
Abstract void close ()
Close handler and release all related resources.
Abstract void flush ()
Refresh all the buffer outputs.
String getencoding ()
Returns the character encoding of the handler.
Errormanager geterrormanager ()
Obtain the errormanager of the handler.
Filter getfilter ()
Obtain the current filter of the handler.
Formatter getformatter ()
Returns the formatter of the handler.
Level getlevel ()
Obtain the log level used to specify the information recorded by the handler.
Boolean isloggable (logrecord record)
Check whether the handler actually records the given logrecord.
Abstract void publish (logrecord record)
Publish a logrecord.
Protected void reporterror (string MSG, exception ex, int code)
The protected convenience method used to report errors to the errormanager of the handler.
Void setencoding (string encoding)
Set the character encoding used by the handler.
Void seterrormanager (errormanager em)
Define an errormanager for the handler.
Void setfilter (filter newfilter)
Set filter to control the output of the handler.
Void setformatter (formatter newformatter)
Set formatter.
Void setlevel (Level newlevel)
Set the log level to specify the information level recorded by the handler.