Reverted to the old way of redirecting stderr and stdout. The try-resource method was closing the stream.
This commit is contained in:
parent
95899c2840
commit
398f4559cf
1 changed files with 6 additions and 5 deletions
|
@ -335,8 +335,9 @@ public class Mobibot extends PircBot {
|
|||
|
||||
// Redirect the stdout and stderr
|
||||
if (!line.hasOption(Commands.DEBUG_ARG.charAt(0))) {
|
||||
try (final PrintStream stdout = new PrintStream(new FileOutputStream(
|
||||
logsDir + channel.substring(1) + '.' + Utils.today() + ".log", true))) {
|
||||
try {
|
||||
final PrintStream stdout = new PrintStream(new FileOutputStream(
|
||||
logsDir + channel.substring(1) + '.' + Utils.today() + ".log", true));
|
||||
System.setOut(stdout);
|
||||
} catch (IOException e) {
|
||||
System.err.println("Unable to open output (stdout) log file.");
|
||||
|
@ -344,9 +345,9 @@ public class Mobibot extends PircBot {
|
|||
System.exit(1);
|
||||
}
|
||||
|
||||
|
||||
try (final PrintStream stderr = new PrintStream(
|
||||
new FileOutputStream(logsDir + nickname + ".err", true))) {
|
||||
try {
|
||||
final PrintStream stderr = new PrintStream(
|
||||
new FileOutputStream(logsDir + nickname + ".err", true));
|
||||
System.setErr(stderr);
|
||||
} catch (IOException e) {
|
||||
System.err.println("Unable to open error (stderr) log file.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue