org.ow2.util.log
Class JDKConsoleHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.ow2.util.log.JDKConsoleHandler

public class JDKConsoleHandler
extends java.util.logging.Handler

Handler that display info message in System.out and error in System.err because JDK implementation prints all messages in System.err and in Eclipse, for example, INFO messages are in red !

Author:
Florent Benoit

Constructor Summary
JDKConsoleHandler()
          Creates a new handler with two appender, System.out and System.err.
 
Method Summary
 void close()
          Close the handler by flushing all writers.
 void flush()
          Flush all the current writers (info and error).
 void publish(java.util.logging.LogRecord logRecord)
          Prints the record on the correct writer.
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDKConsoleHandler

public JDKConsoleHandler()
Creates a new handler with two appender, System.out and System.err.

Method Detail

publish

public void publish(java.util.logging.LogRecord logRecord)
Prints the record on the correct writer.

Specified by:
publish in class java.util.logging.Handler
Parameters:
logRecord - the given record with all info to log.

flush

public void flush()
Flush all the current writers (info and error).

Specified by:
flush in class java.util.logging.Handler

close

public void close()
Close the handler by flushing all writers.

Specified by:
close in class java.util.logging.Handler


Copyright © 2007-2009 OW2 Consortium. All Rights Reserved.