JAL-3954 Log events TaskEventListener.NULL_LISTENER
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 16 May 2023 12:44:09 +0000 (14:44 +0200)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 16 May 2023 12:44:09 +0000 (14:44 +0200)
src/jalview/ws2/actions/api/TaskEventListener.java

index 9dee10c..7427aa8 100644 (file)
@@ -2,6 +2,7 @@ package jalview.ws2.actions.api;
 
 import java.util.List;
 
+import jalview.bin.Console;
 import jalview.ws2.api.JobStatus;
 import jalview.ws2.api.WebServiceJobHandle;
 
@@ -115,32 +116,38 @@ public interface TaskEventListener<T>
     @Override
     public void taskStarted(TaskI source, List subJobs)
     {
+      Console.info("task started with " + subJobs.size() + " jobs");
     }
 
     @Override
     public void taskStatusChanged(TaskI source, JobStatus status)
     {
+      Console.info("task status " + status);
     }
 
     @Override
     public void taskCompleted(TaskI source, Object result)
     {
+      Console.info("task completed");
     }
 
     @Override
     public void taskException(TaskI source, Exception e)
     {
+      Console.info("task failed", e);
     }
 
     @Override
     public void taskRestarted(TaskI source)
     {
+      Console.info("task restarted");
     }
 
     @Override
     public void subJobStatusChanged(TaskI source, JobI job,
             JobStatus status)
     {
+      Console.info("sub-job " + job.getInternalId() + " status " + status);
     }
 
     @Override