Closed
Description
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:
- Check whether there is an tag in the message and if so output no matter if verbosity is quiet or not
- Only output exceptions that are caught by the Application, i.e. "uncaught" exception, regardless of the verbosity.
- 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 likeif ($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
Labels
No labels