浏览代码

change some logging

Baglio Tabifata 4 年之前
父节点
当前提交
5687c12bf8
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java

+ 4 - 2
src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java

@@ -49,14 +49,14 @@ public class DuPALAnalyzer {
 
     public void saveStatus(final String path) {
         try {
-            logger.info("Saving state to " + path);
-
             FileOutputStream fileOut = new FileOutputStream(path);
             ObjectOutputStream out = new ObjectOutputStream(fileOut);
         
             out.writeObject(mStates);
             out.close();
             fileOut.close();
+
+            logger.info("Saved state to " + path);
         } catch (IOException e) {
             logger.warn("Unable to save status to " + path);
             e.printStackTrace();
@@ -71,6 +71,8 @@ public class DuPALAnalyzer {
             mStates = (MacroState[])in.readObject();
             in.close();
             fileIn.close();
+
+            logger.info("Restored state from " + path);
         } catch (ClassNotFoundException e) {
             e.printStackTrace();
         } catch (FileNotFoundException e) {