OSDN Git Service

TaskManage動作ログ出力
authoryukihane <yukihane.feather@gmail.com>
Mon, 29 Aug 2011 02:43:46 +0000 (11:43 +0900)
committeryukihane <yukihane.feather@gmail.com>
Mon, 29 Aug 2011 02:43:46 +0000 (11:43 +0900)
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.logging.Level;
+import java.util.logging.Logger;
 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 {
-
+    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<>();
@@ -119,22 +121,26 @@ public class TaskManage {
 
         @Override
         public void process(V progress) {
+            logger.log(Level.FINEST, "process: {0}", progress);
             // 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) {
+            logger.log(Level.FINE, "done: {0}", result);
             notify(TaskStatus.DONE);
         }
 
         @Override
         public void error(Throwable th) {
+            logger.log(Level.SEVERE, "error", th);
             notify(TaskStatus.ERROR, 0.0, th.getMessage());
         }
     }