View Javadoc

1   // Copyright 2006-2007, by the California Institute of Technology.
2   // ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
3   // Any commercial use must be negotiated with the Office of Technology Transfer
4   // at the California Institute of Technology.
5   //
6   // This software is subject to U. S. export control laws and regulations
7   // (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
8   // is subject to U.S. export control laws and regulations, the recipient has
9   // the responsibility to obtain export licenses or other export authority as
10  // may be required before exporting such information to foreign countries or
11  // providing access to foreign nationals.
12  //
13  // $Id$
14  
15  package gov.nasa.pds.tools.handler;
16  
17  import java.io.OutputStream;
18  import java.util.logging.Formatter;
19  import java.util.logging.Level;
20  import java.util.logging.StreamHandler;
21  
22  /***
23   * This class sets up a stream handler for the tools logging capability.
24   * 
25   * @author mcayanan
26   *
27   */
28  public class ToolsStreamHandler extends StreamHandler {
29  	
30  	/***
31  	 * Constructor. Automatically sets the log level to 'ALL'.
32  	 * 
33  	 * @param out An output stream.
34  	 * @param formatter Formatter to be used to format the log messages.
35  	 */
36  	public ToolsStreamHandler(OutputStream out, Formatter formatter) {
37  		this(out, Level.ALL, formatter);
38  	}
39  	
40  	/***
41  	 * Constructor.
42  	 * @param out An output stream.
43  	 * @param level Sets the log level, specifying which message levels will
44  	 * be logged by this handler.
45  	 * @param formatter Formatter to be used to format the log messages.
46  	 */
47  	public ToolsStreamHandler(OutputStream out, Level level, Formatter formatter) {
48  		super(out, formatter);
49  		setLevel(level);
50  	}
51  }