73 /**
74 * Create a debug print stream to the supplied log file.
75 * @param logFile the file to which debug output will go.
76 * @exception IOException thrown if the file cannot be opened for output.
77 */
78 public static void makeDebugStream(File logFile)
79 throws java.io.IOException {
80 // Create an outputstream for debugging
81 java.io.OutputStream logOStream =
82 new java.io.FileOutputStream(logFile);
83 java.io.DataOutputStream logDStream =
84 new java.io.DataOutputStream(logOStream);
85 debugStream = new java.io.PrintStream(logDStream);
86
87 // Emit first message
88 debugStream.println("Debug Stream Enabled.");
89 }
90
91 /**
92 * Create a error print stream to the supplied file.
93 * @param logFile the file to which error messages will go.
94 * @exception IOException thrown if the file cannot be opened for output.
95 */
96 public static void makeErrStream(File errFile)
97 throws java.io.IOException {
98 if (debug) {
99 // Create an outputstream for errors
100 java.io.OutputStream errOStream =
101 new java.io.FileOutputStream(errFile);
102 java.io.DataOutputStream errDStream =
103 new java.io.DataOutputStream(errOStream);
104 errStream = new java.io.PrintStream(errDStream);
105 dprint("Error stream setup completed.");
106 }
107 }
108
109
110 /**
111 * A utility method that takes Array of NameComponent and converts
112 * into a directory structured name in the format of /id1.kind1/id2.kind2..
113 * This is used mainly for Logging.
|
73 /**
74 * Create a debug print stream to the supplied log file.
75 * @param logFile the file to which debug output will go.
76 * @exception IOException thrown if the file cannot be opened for output.
77 */
78 public static void makeDebugStream(File logFile)
79 throws java.io.IOException {
80 // Create an outputstream for debugging
81 java.io.OutputStream logOStream =
82 new java.io.FileOutputStream(logFile);
83 java.io.DataOutputStream logDStream =
84 new java.io.DataOutputStream(logOStream);
85 debugStream = new java.io.PrintStream(logDStream);
86
87 // Emit first message
88 debugStream.println("Debug Stream Enabled.");
89 }
90
91 /**
92 * Create a error print stream to the supplied file.
93 * @param errFile the file to which error messages will go.
94 * @exception IOException thrown if the file cannot be opened for output.
95 */
96 public static void makeErrStream(File errFile)
97 throws java.io.IOException {
98 if (debug) {
99 // Create an outputstream for errors
100 java.io.OutputStream errOStream =
101 new java.io.FileOutputStream(errFile);
102 java.io.DataOutputStream errDStream =
103 new java.io.DataOutputStream(errOStream);
104 errStream = new java.io.PrintStream(errDStream);
105 dprint("Error stream setup completed.");
106 }
107 }
108
109
110 /**
111 * A utility method that takes Array of NameComponent and converts
112 * into a directory structured name in the format of /id1.kind1/id2.kind2..
113 * This is used mainly for Logging.
|