Skip to content

Comments

fix: Log warnings to the stderr#7914

Draft
theofidry wants to merge 1 commit intorectorphp:mainfrom
theofidry:fix/stderr
Draft

fix: Log warnings to the stderr#7914
theofidry wants to merge 1 commit intorectorphp:mainfrom
theofidry:fix/stderr

Conversation

@theofidry
Copy link
Contributor


protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->errorSymfonyStyle = $output instanceof ConsoleOutputInterface
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is probably a better way to do this with the Laravel Container... But I'm not familiar with it, and I could not really find it, so meanwhile this works.


// disable console output in case of json output formatter
if ($configuration->getOutputFormat() === JsonOutputFormatter::NAME) {
$this->symfonyStyle->setVerbosity(OutputInterface::VERBOSITY_QUIET);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so actually this is how it is solved for the JSON output formatter... This makes me wonder if the suggested approach is the correct one.

Basically:

  • Should those deprecation warnings be part of the report or not? If yes, then the current design is inadequate as we're just logging stuff to the console instead of passing to the reporter.
  • Why is it set to quiet only for JSON? Was it a conscious decision or it actually applies to some but not all output formats?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecration messages are logged to the stdout

1 participant