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  
14  package gov.nasa.pds.tools.handler;
15  
16  import java.io.OutputStream;
17  import java.util.logging.Formatter;
18  import java.util.logging.Level;
19  import java.util.logging.StreamHandler;
20  
21  /***
22   * This class sets up a stream handler for the tools logging capability.
23   * 
24   * @author mcayanan
25   *
26   */
27  public class ToolsStreamHandler extends StreamHandler {
28  	
29  	/***
30  	 * Constructor. Automatically sets the log level to 'ALL'.
31  	 * 
32  	 * @param out An output stream.
33  	 * @param formatter Formatter to be used to format the log messages.
34  	 */
35  	public ToolsStreamHandler(OutputStream out, Formatter formatter) {
36  		this(out, Level.ALL, formatter);
37  	}
38  	
39  	/***
40  	 * Constructor.
41  	 * @param out An output stream.
42  	 * @param level Sets the log level, specifying which message levels will
43  	 * be logged by this handler.
44  	 * @param formatter Formatter to be used to format the log messages.
45  	 */
46  	public ToolsStreamHandler(OutputStream out, Level level, Formatter formatter) {
47  		super(out, formatter);
48  		setLevel(level);
49  	}
50  }