Skip to content

Commit fbba5d9

Browse files
committed
feature #15773 Make the exception output visible even in quiet mode, fixes #15680 (Seldaek)
This PR was merged into the 2.8 branch. Discussion ---------- Make the exception output visible even in quiet mode, fixes #15680 | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15680 | License | MIT | Doc PR | This builds upon #15772 and sets the exception output in Application::renderException to use VERBOSITY_QUIET so that exceptions are always visible. IMO it's a good change but I can see that it is potentially controversial. Commits ------- e9ee8f5 Make the exception output visible even in quiet mode, fixes #15680
2 parents 209f1fc + e9ee8f5 commit fbba5d9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,10 @@ public function renderException($e, $output)
703703
$messages[] = '';
704704
$messages[] = '';
705705

706-
$output->writeln($messages, OutputInterface::OUTPUT_RAW);
706+
$output->writeln($messages, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_QUIET);
707707

708708
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
709-
$output->writeln('<comment>Exception trace:</comment>');
709+
$output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET);
710710

711711
// exception related properties
712712
$trace = $e->getTrace();
@@ -724,18 +724,18 @@ public function renderException($e, $output)
724724
$file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
725725
$line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
726726

727-
$output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line));
727+
$output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET);
728728
}
729729

730-
$output->writeln('');
731-
$output->writeln('');
730+
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
731+
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
732732
}
733733
} while ($e = $e->getPrevious());
734734

735735
if (null !== $this->runningCommand) {
736-
$output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())));
737-
$output->writeln('');
738-
$output->writeln('');
736+
$output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET);
737+
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
738+
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
739739
}
740740
}
741741

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy