Skip to content

Commit

Permalink
reformat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dprzybyl committed Oct 30, 2023
1 parent bf8c770 commit abb4ebc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
package com.cognifide.apm.main.utils;

import com.cognifide.apm.api.scripts.Script;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -75,10 +74,4 @@ public static String unknownPermissions(List<String> permissions) {
return permissions.stream()
.collect(Collectors.joining(", ", "Unknown permissions: ", ""));
}

public static String describeScripts(List<Script> scripts) {
return scripts.stream()
.map(Script::getPath)
.collect(Collectors.joining("\n"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import com.cognifide.apm.api.services.ExecutionMode;
import com.cognifide.apm.api.services.ExecutionResult;
import com.cognifide.apm.api.services.ScriptManager;
import com.cognifide.apm.main.utils.MessagingUtils;
import java.util.List;
import java.util.stream.Collectors;
import javax.jcr.RepositoryException;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.ResourceResolver;
Expand All @@ -41,8 +41,10 @@ public AbstractLauncher() {

protected void processScripts(List<Script> scripts, ResourceResolver resolver) throws PersistenceException {
if (!scripts.isEmpty()) {
logger.info("Launcher will try to run following scripts: {}", scripts.size());
logger.info(MessagingUtils.describeScripts(scripts));
String scriptPathsStr = scripts.stream()
.map(Script::getPath)
.collect(Collectors.joining("\n"));
logger.info("Launcher will try to run following scripts: {}\n{}", scripts.size(), scriptPathsStr);
for (Script script : scripts) {
processScript(script, resolver);
}
Expand Down

0 comments on commit abb4ebc

Please sign in to comment.