Skip to content

Commit

Permalink
Merge pull request #444 from wttech/logger
Browse files Browse the repository at this point in the history
added additional logging to script manager
  • Loading branch information
dprzybyl authored Jul 4, 2024
2 parents aebd66a + adfa740 commit 30e63a4
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@
*/
package com.cognifide.apm.core.scripts;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.stream.Collectors;

import org.apache.jackrabbit.api.JackrabbitSession;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.ResourceResolver;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cognifide.apm.api.actions.ActionResult;
import com.cognifide.apm.api.actions.Context;
import com.cognifide.apm.api.actions.SessionSavingMode;
Expand Down Expand Up @@ -150,6 +168,9 @@ private Progress execute(Script script, ExecutionMode mode, Map<String, String>
}
if (progress.isSuccess()) {
savingPolicy.save(context.getSession(), SessionSavingMode.SINGLE);
LOGGER.info(String.format("Script execution completed successfully: %s [%s]", path, mode));
} else {
LOGGER.info(String.format("Script execution failed: %s [%s]", path, mode));
}
return progress;
}
Expand Down

0 comments on commit 30e63a4

Please sign in to comment.