From 24b5bc549da89f4c6d7ea50ad7c5d7782ae089a8 Mon Sep 17 00:00:00 2001 From: "steve.brazier" Date: Mon, 10 Mar 2014 12:08:16 +0000 Subject: [PATCH] Add debug logging to findBinary() --- PHPCI/Helper/CommandExecutor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PHPCI/Helper/CommandExecutor.php b/PHPCI/Helper/CommandExecutor.php index 9b7fe442..a422d970 100644 --- a/PHPCI/Helper/CommandExecutor.php +++ b/PHPCI/Helper/CommandExecutor.php @@ -4,6 +4,7 @@ namespace PHPCI\Helper; use \PHPCI\Logging\BuildLogger; +use Psr\Log\LogLevel; class CommandExecutor { @@ -112,13 +113,16 @@ class CommandExecutor } foreach ($binary as $bin) { + $this->logger->log("Looking for binary: " . $bin, LogLevel::DEBUG); // Check project root directory: if (is_file($this->rootDir . $bin)) { + $this->logger->log("Found in root: " . $bin, LogLevel::DEBUG); return $this->rootDir . $bin; } // Check Composer bin dir: if (is_file($this->rootDir . 'vendor/bin/' . $bin)) { + $this->logger->log("Found in vendor/bin: " . $bin, LogLevel::DEBUG); return $this->rootDir . 'vendor/bin/' . $bin; } @@ -127,6 +131,7 @@ class CommandExecutor $findCmdResult = trim(shell_exec($findCmd . ' ' . $bin)); if (!empty($findCmdResult)) { + $this->logger->log("Found in " . $findCmdResult, LogLevel::DEBUG); return $findCmdResult; } }