FileDocCategorySizeDatePackage
ConsoleHandler.javaAPI DocAndroid 1.5 API2693Wed May 06 22:41:04 BST 2009java.util.logging

ConsoleHandler

public class ConsoleHandler extends StreamHandler
A handler that writes log messages to the standard output stream {@code System.err}.

This handler reads the following properties from the log manager to initialize itself:

  • java.util.logging.ConsoleHandler.level specifies the logging level, defaults to {@code Level.INFO} if this property is not found or has an invalid value.
  • java.util.logging.ConsoleHandler.filter specifies the name of the filter class to be associated with this handler, defaults to {@code null} if this property is not found or has an invalid value.
  • java.util.logging.ConsoleHandler.formatter specifies the name of the formatter class to be associated with this handler, defaults to {@code java.util.logging.SimpleFormatter} if this property is not found or has an invalid value.
  • java.util.logging.ConsoleHandler.encoding specifies the encoding this handler will use to encode log messages, defaults to {@code null} if this property is not found or has an invalid value.

This class is not thread-safe.

since
Android 1.0

Fields Summary
Constructors Summary
public ConsoleHandler()
Constructs a {@code ConsoleHandler} object.

since
Android 1.0

        super(System.err);
    
Methods Summary
public voidclose()
Closes this handler. The {@code System.err} is flushed but not closed.

since
Android 1.0

        super.close(false);
    
public voidpublish(java.util.logging.LogRecord record)
Logs a record if necessary. A flush operation will be done.

param
record the log record to be logged.
since
Android 1.0

        super.publish(record);
        super.flush();