Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console] RFC for Symfony 3.0: Show errors even when --quiet is present #15680

Copy link
Copy link
Closed
@Seldaek

Description

@Seldaek
Issue body actions

I'd like to discuss this (sort of BC breaking) change for 3.0. The problem is in most cases people use --quiet / -q when running a console app, they don't want any output but still expect output/details in case an error occurs.

I see a few options to handle this:

  1. Check whether there is an tag in the message and if so output no matter if verbosity is quiet or not
  2. Only output exceptions that are caught by the Application, i.e. "uncaught" exception, regardless of the verbosity.
  3. Add an optional parameter to OutputInterface::write/writeln, that would be defined as $verbosity = self::VERBOSITY_NORMAL. That would allow any write call to contain information about which verbosity level it should be written to. I think that would be quite nice because it also enables dropping a lot of conditionals like if ($output->isVeryVerbose()) { $output->writeln(...); }, those would become $output->writeln('foo', OutputInterface::OUTPUT_NORMAL, OutputInterface::VERBOSITY_VERY_VERBOSE); which reads a bit better, except for the constants being long as hell and the OUTPUT type sitting in the middle (not sure if that'd be too much of a BC break to add the new arg as second argument, I've never seen the output type being used in the wild, or maybe both could be cobbled together as a bitwise flag).

Point 3 would be nice either way I think, and it would allow some messages to pass through the quiet mode, so if you do a write with VERBOSITY_QUIET it would always be sent, but VERBOSITY_NORMAL and above wouldn't be sent in quiet mode. Similarly we could change the exception writing to be written on the quiet verbosity.

If anyone has another idea or comments that'd be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.