// Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/StringUtils.java
// public class StringUtils {
// 
//   /**
//    * Joins the elements of the provided collection into a single String containing the provided list of elements.
//    * <p>
//    * No delimiter is added before or after the list.
//    * <p>
//    * Empty collections return an empty String.
//    */
//   public static <T> String join(Collection<T> collection, CharSequence joinedBy) {
//     if (collection.isEmpty()) {
//       return "";
//     }
//     StringBuilder stringBuilder = new StringBuilder(256);
//     for (T t : collection) {
//       stringBuilder.append(t.toString()).append(joinedBy);
//     }
//     return stringBuilder.substring(0, stringBuilder.length() - joinedBy.length());
//   }
// 
// }


import io.arivera.oss.embedded.rabbitmq.util.StringUtils;
import org.slf4j.Logger;
import org.zeroturnaround.exec.InvalidExitValueException;
import org.zeroturnaround.exec.ProcessExecutor;
import org.zeroturnaround.exec.ProcessResult;
import org.zeroturnaround.exec.listener.ProcessListener;
package io.arivera.oss.embedded.rabbitmq.bin;



class LoggingProcessListener extends ProcessListener {

  private final Logger logger;
  private ProcessExecutor executor;

  LoggingProcessListener(Logger logger) {
    this.logger = logger;
  }

  @Override
  public void beforeStart(ProcessExecutor executor) {
    this.executor = executor;
    logger.debug("Executing '{}' with environment vars: {}",
// Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/StringUtils.java
// public class StringUtils {
// 
//   /**
//    * Joins the elements of the provided collection into a single String containing the provided list of elements.
//    * <p>
//    * No delimiter is added before or after the list.
//    * <p>
//    * Empty collections return an empty String.
//    */
//   public static <T> String join(Collection<T> collection, CharSequence joinedBy) {
//     if (collection.isEmpty()) {
//       return "";
//     }
//     StringBuilder stringBuilder = new StringBuilder(256);
//     for (T t : collection) {
//       stringBuilder.append(t.toString()).append(joinedBy);
//     }
//     return stringBuilder.substring(0, stringBuilder.length() - joinedBy.length());
//   }
// 
// }


// Path: src/main/java/io/arivera/oss/embedded/rabbitmq/bin/LoggingProcessListener.java
import io.arivera.oss.embedded.rabbitmq.util.StringUtils;
import org.slf4j.Logger;
import org.zeroturnaround.exec.InvalidExitValueException;
import org.zeroturnaround.exec.ProcessExecutor;
import org.zeroturnaround.exec.ProcessResult;
import org.zeroturnaround.exec.listener.ProcessListener;

package io.arivera.oss.embedded.rabbitmq.bin;



class LoggingProcessListener extends ProcessListener {

  private final Logger logger;
  private ProcessExecutor executor;

  LoggingProcessListener(Logger logger) {
    this.logger = logger;
  }

  @Override
  public void beforeStart(ProcessExecutor executor) {
    this.executor = executor;
    logger.debug("Executing '{}' with environment vars: {}",
        StringUtils.join(executor.getCommand(), " "), executor.getEnvironment());