com.mays.util
Class OutConsoleHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by java.util.logging.StreamHandler
          extended by com.mays.util.OutConsoleHandler

public class OutConsoleHandler
extends StreamHandler

Similar to ConsoleHandler, but uses System.out rather than System.err. Would be nice to extend ConsoleHandler instead of StreamHandler, but the method setOutputStream actually closes the stream. We wouldn't want that to happen to System.err since that would make all our errors go away.

Author:
Eric Mays
See Also:
ConsoleHandler, StreamHandler

Constructor Summary
OutConsoleHandler()
          Create a ConsoleHandler for System.out.
 
Method Summary
 void close()
          Just flush.
 void publish(LogRecord rec)
          Override this to flush immediately.
 
Methods inherited from class java.util.logging.StreamHandler
flush, isLoggable, setEncoding, setOutputStream
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutConsoleHandler

public OutConsoleHandler()
Create a ConsoleHandler for System.out.

Method Detail

close

public void close()
           throws SecurityException
Just flush.

Overrides:
close in class StreamHandler
Throws:
SecurityException
See Also:
StreamHandler.close()

publish

public void publish(LogRecord rec)
Override this to flush immediately.

Overrides:
publish in class StreamHandler
See Also:
StreamHandler.publish(java.util.logging.LogRecord)