View Javadoc
1 /* 2 Bloof - visualize the evolution of your software project 3 Copyright ( C ) 2003 Lukasz Pekacki <lukasz@pekacki.de> 4 http://bloof.sf.net/ 5 6 This program is free software; you can redistribute it and/or modify it 7 under the terms of the GNU General Public License. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 this program; if not, write to the Free Software Foundation, Inc., 16 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 18 $RCSfile: ConsoleOutHandler.java,v $ 19 Created on $Date: 2003/10/13 18:05:07 $ 20 */ 21 package net.sf.bloof.websuite.logging; 22 23 import java.util.logging.Level; 24 import java.util.logging.LogRecord; 25 import java.util.logging.StreamHandler; 26 27 /*** 28 * A simplified copy of <code>java.util.logging.ConsoleHandler</code>. 29 * It writes to <code>System.out</code> instead of 30 * <code>System.err</code> and uses the {@link LogFormatter} 31 * to format 32 * @author Richard Cyganiak <rcyg@gmx.de> 33 * @version $Id: ConsoleOutHandler.java,v 1.1 2003/10/13 18:05:07 pekacki Exp $ 34 */ 35 public class ConsoleOutHandler extends StreamHandler { 36 37 /*** 38 * Create a <tt>ConsoleOutHandler</tt> for <tt>System.out</tt>. 39 */ 40 public ConsoleOutHandler() { 41 setLevel(Level.FINEST); 42 setFormatter(new LogFormatter()); 43 setOutputStream(System.out); 44 } 45 46 /*** 47 * Override <tt>StreamHandler.close</tt> to do a flush but not 48 * to close the output stream. That is, we do <b>not</b> 49 * close <tt>System.err</tt>. 50 */ 51 public void close() { 52 flush(); 53 } 54 55 /*** 56 * Publish a <tt>LogRecord</tt>. 57 * <p> 58 * The logging request was made initially to a <tt>Logger</tt> object, 59 * which initialized the <tt>LogRecord</tt> and forwarded it here. 60 * <p> 61 * @param aRecord dewebsuiteion of the log event 62 */ 63 public void publish(LogRecord aRecord) { 64 super.publish(aRecord); 65 flush(); 66 } 67 }

This page was automatically generated by Maven