This displayed poorly for me, so I untabified it. Whitespace changed only.
This commit is contained in:
parent
0ee90a0fb0
commit
72442788c1
1 changed files with 27 additions and 27 deletions
|
@ -87,18 +87,18 @@ public class ThdlDebug {
|
||||||
throws ThdlLazyException
|
throws ThdlLazyException
|
||||||
{
|
{
|
||||||
|
|
||||||
/* FIXME: find all calls to this function and rethink or shore
|
/* FIXME: find all calls to this function and rethink or shore
|
||||||
up the calling code. */
|
up the calling code. */
|
||||||
|
|
||||||
if (ThdlOptions.getBooleanOption("thdl.debug"))
|
if (ThdlOptions.getBooleanOption("thdl.debug"))
|
||||||
throw new ThdlLazyException(new Error("You've reached some iffy code, some code that's not well thought-out. Because you invoked the Java runtime environment with the property thdl.debug set to true (developers: use 'ant -Dthdl.debug=false' to prevent this), or because you set the thdl.debug preference to true in one of the preferences files, the program is now aborting."));
|
throw new ThdlLazyException(new Error("You've reached some iffy code, some code that's not well thought-out. Because you invoked the Java runtime environment with the property thdl.debug set to true (developers: use 'ant -Dthdl.debug=false' to prevent this), or because you set the thdl.debug preference to true in one of the preferences files, the program is now aborting."));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Exits the program with a message that the CLASSPATH is not set
|
/** Exits the program with a message that the CLASSPATH is not set
|
||||||
properly. */
|
properly. */
|
||||||
public static void handleClasspathError(String whoseWhat, Throwable error) {
|
public static void handleClasspathError(String whoseWhat, Throwable error) {
|
||||||
System.err.println(((whoseWhat == null) ? "Your CLASSPATH" : whoseWhat)
|
System.err.println(((whoseWhat == null) ? "Your CLASSPATH" : whoseWhat)
|
||||||
+ " is not set properly.");
|
+ " is not set properly.");
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
System.err.println("Note that Savant and QuillDriver CANNOT be invoked via the");
|
System.err.println("Note that Savant and QuillDriver CANNOT be invoked via the");
|
||||||
|
@ -107,17 +107,17 @@ public class ThdlDebug {
|
||||||
System.err.println("either, because we don't set the JARs' manifest files to contain");
|
System.err.println("either, because we don't set the JARs' manifest files to contain");
|
||||||
System.err.println("Class-path attributes. See installation instructions."); /* FIXME: we don't HAVE installation instructions, do we? */
|
System.err.println("Class-path attributes. See installation instructions."); /* FIXME: we don't HAVE installation instructions, do we? */
|
||||||
System.err.println("");
|
System.err.println("");
|
||||||
System.err.println("Details: Missing class: "
|
System.err.println("Details: Missing class: "
|
||||||
+ ((error == null)
|
+ ((error == null)
|
||||||
? "unknown!" : error.getMessage()));
|
? "unknown!" : error.getMessage()));
|
||||||
if (ThdlOptions.getBooleanOption("thdl.debug")) {
|
if (ThdlOptions.getBooleanOption("thdl.debug")) {
|
||||||
System.err.println("Details: Stack trace: "
|
System.err.println("Details: Stack trace: "
|
||||||
+ ((error == null)
|
+ ((error == null)
|
||||||
? "unknown!" : error.getMessage()));
|
? "unknown!" : error.getMessage()));
|
||||||
error.printStackTrace(System.err);
|
error.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Exits the program the hard way. Don't ever call this for code
|
/** Exits the program the hard way. Don't ever call this for code
|
||||||
that you expect to be executed. */
|
that you expect to be executed. */
|
||||||
|
@ -130,12 +130,12 @@ public class ThdlDebug {
|
||||||
System.exit(37);
|
System.exit(37);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets it up so that a call to System.out or System.err prints
|
/** Sets it up so that a call to System.out or System.err prints
|
||||||
* to standard output/error but ALSO prints to the log file named
|
* to standard output/error but ALSO prints to the log file named
|
||||||
* (prefix + suffix). Be sure the log file name is a relative
|
* (prefix + suffix). Be sure the log file name is a relative
|
||||||
* path, because we may put this file into an arbitrary
|
* path, because we may put this file into an arbitrary
|
||||||
* directory. */
|
* directory. */
|
||||||
public static void attemptToSetUpLogFile(String prefix, String suffix) {
|
public static void attemptToSetUpLogFile(String prefix, String suffix) {
|
||||||
if (ThdlOptions.getBooleanOption("thdl.disable.log.file"))
|
if (ThdlOptions.getBooleanOption("thdl.disable.log.file"))
|
||||||
return;
|
return;
|
||||||
// Else:
|
// Else:
|
||||||
|
@ -193,20 +193,20 @@ public class ThdlDebug {
|
||||||
logFile = new File(prefix + suffix);
|
logFile = new File(prefix + suffix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
PrintStream logFilePrintStream
|
PrintStream logFilePrintStream
|
||||||
= new PrintStream(new FileOutputStream(logFile));
|
= new PrintStream(new FileOutputStream(logFile));
|
||||||
System.out.println("Logging to "
|
System.out.println("Logging to "
|
||||||
+ logFile.getAbsolutePath().toString()
|
+ logFile.getAbsolutePath().toString()
|
||||||
+ ".");
|
+ ".");
|
||||||
System.out.println("Please include the contents of the log file in any bug reports.");
|
System.out.println("Please include the contents of the log file in any bug reports.");
|
||||||
PrintStream psOut = new TeeStream(System.out, logFilePrintStream);
|
PrintStream psOut = new TeeStream(System.out, logFilePrintStream);
|
||||||
PrintStream psErr = new TeeStream(System.err, logFilePrintStream);
|
PrintStream psErr = new TeeStream(System.err, logFilePrintStream);
|
||||||
System.setErr(psErr);
|
System.setErr(psErr);
|
||||||
System.setOut(psOut);
|
System.setOut(psOut);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
/* don't let this stop us. */
|
/* don't let this stop us. */
|
||||||
noteIffyCode();
|
noteIffyCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
Loading…
Reference in a new issue