Skip to content

Commit

Permalink
Add more details to event debug output, refs #11818
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Feb 7, 2024
1 parent fd23381 commit fa04013
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Composer/EventDispatcher/EventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
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;
Expand Down Expand Up @@ -180,6 +182,10 @@ protected function doDispatch(Event $event)
$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');
}
Expand Down

0 comments on commit fa04013

Please sign in to comment.