1
0
Fork 0

Add more details to event debug output, refs #11818

pull/11688/head
Jordi Boggiano 2024-02-07 11:17:54 +01:00
parent fd23381391
commit fa040131b0
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,8 @@ use Composer\IO\IOInterface;
use Composer\Composer;
use Composer\PartialComposer;
use Composer\Pcre\Preg;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PreCommandRunEvent;
use Composer\Util\Platform;
use Composer\DependencyResolver\Operation\OperationInterface;
use Composer\Repository\RepositoryInterface;
@ -180,6 +182,10 @@ class EventDispatcher
$details = null;
if ($event instanceof PackageEvent) {
$details = (string) $event->getOperation();
} elseif ($event instanceof CommandEvent) {
$details = $event->getCommandName();
} elseif ($event instanceof PreCommandRunEvent) {
$details = $event->getCommand();
}
$this->io->writeError('Dispatching <info>'.$event->getName().'</info>'.($details ? ' ('.$details.')' : '').' event');
}