Use a debug system property to control debugging.
When set, it disables stdout/stderr redirection and uses java.exe on Windows so that a console window is shown with output from the launched app. This removes the use of a debug.txt file.
This commit is contained in:
@@ -784,10 +784,6 @@ public class Application
|
||||
// extract some info used to configure our child process on macOS
|
||||
_dockName = config.getString("ui.name");
|
||||
_dockIconPath = config.getString("ui.mac_dock_icon", "../desktop.icns");
|
||||
|
||||
// look for a debug.txt file which causes us to run in java.exe on Windows so that we can
|
||||
// obtain a thread dump of the running JVM
|
||||
_windebug = getLocalPath("debug.txt").exists();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -967,7 +963,7 @@ public class Application
|
||||
ArrayList<String> args = new ArrayList<>();
|
||||
|
||||
// reconstruct the path to the JVM
|
||||
args.add(LaunchUtil.getJVMBinaryPath(_javaLocalDir, _windebug || optimum));
|
||||
args.add(LaunchUtil.getJVMBinaryPath(_javaLocalDir, SysProps.debug() || optimum));
|
||||
|
||||
// check whether we're using -jar mode or -classpath mode
|
||||
boolean dashJarMode = MANIFEST_CLASS.equals(_class);
|
||||
@@ -1737,7 +1733,6 @@ public class Application
|
||||
protected String _dockName;
|
||||
protected String _dockIconPath;
|
||||
protected boolean _strictComments;
|
||||
protected boolean _windebug;
|
||||
protected boolean _allowOffline;
|
||||
protected int _maxConcDownloads;
|
||||
|
||||
|
||||
@@ -40,6 +40,14 @@ public final class SysProps
|
||||
return System.getProperty("no_log_redir") != null;
|
||||
}
|
||||
|
||||
/** Used to debug Getdown's launching of an app. When set, it disables redirection of stdout
|
||||
* and stderr into a log file, and on Windows it uses {@code java.exe} to launch the app so
|
||||
* that its console output can be observed.
|
||||
* Usage: {@code -Ddebug}. */
|
||||
public static boolean debug () {
|
||||
return System.getProperty("debug") != null;
|
||||
}
|
||||
|
||||
/** Overrides the domain on {@code appbase}. Usage: {@code -Dappbase_domain=foo}. */
|
||||
public static String appbaseDomain () {
|
||||
return System.getProperty("appbase_domain");
|
||||
|
||||
@@ -66,7 +66,7 @@ public class GetdownApp
|
||||
}
|
||||
|
||||
// pipe our output into a file in the application directory
|
||||
if (!SysProps.noLogRedir()) {
|
||||
if (!SysProps.noLogRedir() && !SysProps.debug()) {
|
||||
File logFile = new File(envc.appDir, "launcher.log");
|
||||
try {
|
||||
PrintStream logOut = new PrintStream(
|
||||
|
||||
Reference in New Issue
Block a user