Skip to content

Commit

Permalink
add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
NightDev701 committed Jun 2, 2024
1 parent 575e3c0 commit ce6770d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ public OpenPrintStream(AbstractLogger logger) throws FileNotFoundException {
@Override
public void println(String x) {
logger.log(Level.INFO, x);
new File("alternative_log.txt").delete();
var r = new File("alternative_log.txt").delete();

if(!r){
logger.log(Level.WARNING, "Could not delete alternative_log.txt file");
}
}

@Override
Expand Down

0 comments on commit ce6770d

Please sign in to comment.