Add event name in verbose mode, refs #4123
parent
852e4f4e26
commit
a8d71be0ef
|
@ -173,7 +173,11 @@ class EventDispatcher
|
||||||
} else {
|
} else {
|
||||||
$args = implode(' ', array_map(array('Composer\Util\ProcessExecutor', 'escape'), $event->getArguments()));
|
$args = implode(' ', array_map(array('Composer\Util\ProcessExecutor', 'escape'), $event->getArguments()));
|
||||||
$exec = $callable . ($args === '' ? '' : ' '.$args);
|
$exec = $callable . ($args === '' ? '' : ' '.$args);
|
||||||
|
if ($this->io->isVerbose()) {
|
||||||
|
$this->io->writeError(sprintf('> %s: %s', $event->getName(), $exec));
|
||||||
|
} else {
|
||||||
$this->io->writeError(sprintf('> %s', $exec));
|
$this->io->writeError(sprintf('> %s', $exec));
|
||||||
|
}
|
||||||
if (0 !== ($exitCode = $this->process->execute($exec))) {
|
if (0 !== ($exitCode = $this->process->execute($exec))) {
|
||||||
$this->io->writeError(sprintf('<error>Script %s handling the %s event returned with an error</error>', $callable, $event->getName()));
|
$this->io->writeError(sprintf('<error>Script %s handling the %s event returned with an error</error>', $callable, $event->getName()));
|
||||||
|
|
||||||
|
@ -198,7 +202,11 @@ class EventDispatcher
|
||||||
{
|
{
|
||||||
$event = $this->checkListenerExpectedEvent(array($className, $methodName), $event);
|
$event = $this->checkListenerExpectedEvent(array($className, $methodName), $event);
|
||||||
|
|
||||||
|
if ($this->io->isVerbose()) {
|
||||||
|
$this->io->writeError(sprintf('> %s: %s::%s', $event->getName(), $className, $methodName));
|
||||||
|
} else {
|
||||||
$this->io->writeError(sprintf('> %s::%s', $className, $methodName));
|
$this->io->writeError(sprintf('> %s::%s', $className, $methodName));
|
||||||
|
}
|
||||||
|
|
||||||
return $className::$methodName($event);
|
return $className::$methodName($event);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue