Skip to content

Commit

Permalink
Redirecting all output of installerto a .jdeploy/log/jdeploy-installe…
Browse files Browse the repository at this point in the history
…r.log
  • Loading branch information
shannah committed Jan 14, 2022
1 parent 22070e7 commit 2863784
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions installer/src/main/java/ca/weblite/jdeploy/installer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,17 @@ private static String ifEmpty(String... value) {
}

public static void main(String[] args) {
File logFile = new File(System.getProperty("user.home") + File.separator + ".jdeploy" + File.separator + "log" + File.separator + "jdeploy-installer.log");
logFile.getParentFile().mkdirs();
try {
PrintStream originalOut = System.out;
System.setOut(new PrintStream(new FileOutputStream(logFile)));
originalOut.println("Redirecting output to "+logFile);
System.setErr(System.out);
} catch (IOException ex) {
System.err.println("Failed to redirect output to "+logFile);
ex.printStackTrace(System.err);
}

EventQueue.invokeLater(new Main());
}
Expand Down

0 comments on commit 2863784

Please sign in to comment.