OSDN Git Service

TaskManage動作ログ出力
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / manager / TaskManage.java
index dbb1fcc..35a719e 100644 (file)
@@ -5,6 +5,8 @@ import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import saccubus.worker.WorkerListener;
 import saccubus.worker.convert.Convert;
 import saccubus.worker.convert.ConvertProgress;
 import saccubus.worker.WorkerListener;
 import saccubus.worker.convert.Convert;
 import saccubus.worker.convert.ConvertProgress;
@@ -20,7 +22,7 @@ import saccubus.worker.profile.DownloadProfile;
  * @author yuki
  */
 public class TaskManage {
  * @author yuki
  */
 public class TaskManage {
-
+    private static final Logger logger = Logger.getLogger(TaskManage.class.getName());
     private final ExecutorService downloadExecutorService;
     private final ExecutorService convertExecutorService;
     private final Map<Integer, ManageTarget<DownloadResult>> downloadTargets = new HashMap<>();
     private final ExecutorService downloadExecutorService;
     private final ExecutorService convertExecutorService;
     private final Map<Integer, ManageTarget<DownloadResult>> downloadTargets = new HashMap<>();
@@ -119,22 +121,26 @@ public class TaskManage {
 
         @Override
         public void process(V progress) {
 
         @Override
         public void process(V progress) {
+            logger.log(Level.FINEST, "process: {0}", progress);
             // TOOD
             notify(TaskStatus.DOING, 0.0, "");
         }
 
         @Override
         public void cancelled() {
             // TOOD
             notify(TaskStatus.DOING, 0.0, "");
         }
 
         @Override
         public void cancelled() {
+            logger.log(Level.FINE, "cancelled: {0}", toString());
             notify(TaskStatus.CANCELLED);
         }
 
         @Override
         public void done(T result) {
             notify(TaskStatus.CANCELLED);
         }
 
         @Override
         public void done(T result) {
+            logger.log(Level.FINE, "done: {0}", result);
             notify(TaskStatus.DONE);
         }
 
         @Override
         public void error(Throwable th) {
             notify(TaskStatus.DONE);
         }
 
         @Override
         public void error(Throwable th) {
+            logger.log(Level.SEVERE, "error", th);
             notify(TaskStatus.ERROR, 0.0, th.getMessage());
         }
     }
             notify(TaskStatus.ERROR, 0.0, th.getMessage());
         }
     }