[Swift-commit] r3412 - branches/woz-01/src/org/griphyn/vdl/karajan/lib

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Jun 23 13:22:10 CDT 2010


Author: wozniak
Date: 2010-06-23 13:22:10 -0500 (Wed, 23 Jun 2010)
New Revision: 3412

Modified:
   branches/woz-01/src/org/griphyn/vdl/karajan/lib/Execute.java
Log:
Cleaner INFO line for Task submission


Modified: branches/woz-01/src/org/griphyn/vdl/karajan/lib/Execute.java
===================================================================
--- branches/woz-01/src/org/griphyn/vdl/karajan/lib/Execute.java	2010-06-23 18:21:37 UTC (rev 3411)
+++ branches/woz-01/src/org/griphyn/vdl/karajan/lib/Execute.java	2010-06-23 18:22:10 UTC (rev 3412)
@@ -5,6 +5,8 @@
 
 import org.apache.log4j.Logger;
 import org.globus.cog.abstraction.impl.common.StatusEvent;
+import org.globus.cog.abstraction.interfaces.Specification;
+import org.globus.cog.abstraction.interfaces.JobSpecification;
 import org.globus.cog.abstraction.interfaces.Status;
 import org.globus.cog.abstraction.interfaces.Task;
 import org.globus.cog.karajan.arguments.Arg;
@@ -44,17 +46,7 @@
 			Object constraints) throws ExecutionException {
 		try {
 			registerReplica(stack, task);
-			if (logger.isDebugEnabled()) {
-				logger.debug(task);
-				logger.debug("Submitting task " + task);
-			}
-			String jobid = (String)A_JOBID.getValue(stack,null);
-			if (logger.isDebugEnabled()) {
-			    logger.debug("jobid="+jobid+" task=" + task);
-			}
-			else if (logger.isInfoEnabled()) { 
-			    logger.info("Submit: " + task.getSpecification());
-			}
+                        log(task, stack);
 			scheduler.addJobStatusListener(this, task);
 			synchronized (tasks) {
 				tasks.put(task, stack);
@@ -69,6 +61,32 @@
 		}
 	}
 
+        void log(Task task, VariableStack stack)
+            throws ExecutionException
+        {
+            if (logger.isDebugEnabled()) {
+                logger.debug(task);
+                logger.debug("Submitting task " + task);
+            }
+            String jobid = (String)A_JOBID.getValue(stack,null);
+            if (logger.isDebugEnabled()) {
+                logger.debug("jobid="+jobid+" task=" + task);
+            }
+            else if (logger.isInfoEnabled()) {
+                Specification spec = task.getSpecification();
+                if (spec instanceof JobSpecification) {
+                    JobSpecification jobspec = (JobSpecification) spec;
+                    logger.info("Submit: " +
+                                "in: " + jobspec.getDirectory() +
+                                " command: " + jobspec.getExecutable() + 
+                                " " + jobspec.getArguments());
+                }
+                else {
+                    logger.info("Submit: " + spec);
+                }
+            }
+        }
+            
 	protected void registerReplica(VariableStack stack, Task task) throws CanceledReplicaException {
 		setTaskIdentity(stack, task);
 		try {




More information about the Swift-commit mailing list