KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > util > log > util > OutputStreamLogger


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE file.
7  */

8 package org.jivesoftware.util.log.util;
9
10 import org.jivesoftware.util.log.Logger;
11 import org.jivesoftware.util.log.Priority;
12
13 /**
14  * Redirect an output stream to a logger.
15  * This class is useful to redirect standard output or
16  * standard error to a Logger. An example use is
17  * <p/>
18  * <pre>
19  * final OutputStreamLogger outputStream =
20  * new OutputStreamLogger( logger, Priority.DEBUG );
21  * final PrintStream output = new PrintStream( outputStream, true );
22  * <p/>
23  * System.setOut( output );
24  * </pre>
25  *
26  * @author <a HREF="mailto:peter@apache.org">Peter Donald</a>
27  * @deprecated Use LoggerOutputStream as this class was misnamed.
28  */

29 public class OutputStreamLogger
30         extends LoggerOutputStream {
31
32     /**
33      * Construct logger to send to a particular logger at a particular priority.
34      *
35      * @param logger the logger to send to
36      * @param priority the priority at which to log
37      * @deprecated Use LoggerOutputStream as this class was misnamed.
38      */

39     public OutputStreamLogger(final Logger logger,
40                               final Priority priority) {
41         super(logger, priority);
42     }
43 }
44
Popular Tags