Example usage for java.util.logging Handler setFilter

List of usage examples for java.util.logging Handler setFilter

Introduction

In this page you can find the example usage for java.util.logging Handler setFilter.

Prototype

public synchronized void setFilter(Filter newFilter) throws SecurityException 

Source Link

Document

Set a Filter to control output on this Handler .

Usage

From source file:de.ailis.jasdoc.Main.java

/**
 * Initializes logging./* w  ww .  j  a  v  a 2s.  c om*/
 */
private void initLogging() {
    final Logger logger = Logger.getLogger("de.ailis.jasdoc");
    logger.setUseParentHandlers(false);
    final Handler handler = new LogHandler();
    handler.setFilter(null);
    handler.setFormatter(new LogFormatter(this.debug));
    if (this.debug)
        handler.setLevel(Level.ALL);
    else if (this.quiet)
        handler.setLevel(Level.WARNING);
    else
        handler.setLevel(Level.INFO);
    logger.setFilter(null);
    logger.addHandler(handler);
    Logger.getLogger("").setLevel(handler.getLevel());
}