01: /*
02: * Copyright (C) The Apache Software Foundation. All rights reserved.
03: *
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08: package org.jivesoftware.util.log.util;
09:
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 extends LoggerOutputStream {
30:
31: /**
32: * Construct logger to send to a particular logger at a particular priority.
33: *
34: * @param logger the logger to send to
35: * @param priority the priority at which to log
36: * @deprecated Use LoggerOutputStream as this class was misnamed.
37: */
38: public OutputStreamLogger(final Logger logger,
39: final Priority priority) {
40: super(logger, priority);
41: }
42: }
|