Browse Source

PrismLog: implement Closable / AutoClosable [with Steffen Maercker]

This allows for PrismLogs to be used in
try (PrismLog log = ...) {
  ...
}
blocks (Java 7 style resource blocks). When leaving the try block,
the log is automatically closed. This can be helpful in long-running
processes to get a look at a PrismFileLog output, as closing the log
forces a flush as well. 


git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10574 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 10 years ago
parent
commit
7d049a979d
  1. 4
      prism/src/prism/PrismLog.java

4
prism/src/prism/PrismLog.java

@ -27,7 +27,9 @@
package prism;
public abstract class PrismLog
import java.io.Closeable;
public abstract class PrismLog implements Closeable, AutoCloseable
{
/**
* Specifies that only more important messages should be printed

Loading…
Cancel
Save