-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added an example for a different method of verbosity level usage. #6690
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@smatyas I like it! However, lately in the docs we try to minimize the text and instead explain more things inside the code samples. So, what about moving your explanation to the above code example? Something like this: It is possible to print a message in a command for only a specific verbosity
level. For example::
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
$output->writeln(...);
}
// alternatively you can pass the verbosity level to writeln()
$output->writeln('...', OutputInterface::VERBOSITY_VERBOSE); |
smatyas
force-pushed
the
console-verbosity-level-usage
branch
from
June 28, 2016 09:20
365c870
to
58f0f09
Compare
Thanks for the suggestion, applied and squashed. |
👍 Note to the merger: this feature is introduced in 2.8, it should be merged into the 2.8 version of the docs. Status: reviewed |
👍 |
xabbuh
added a commit
that referenced
this pull request
Jun 30, 2016
…vel usage. (smatyas) This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #6690). Discussion ---------- Added an example for a different method of verbosity level usage. Setting a message level like in the added example, was not yet documented. I just found out this method by looking into the code. I also tested with some dummy command that it really does what I thought: ``` protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln('quiet', OutputInterface::VERBOSITY_QUIET); $output->writeln('normal', OutputInterface::VERBOSITY_NORMAL); $output->writeln('verbose', OutputInterface::VERBOSITY_VERBOSE); $output->writeln('very verbose', OutputInterface::VERBOSITY_VERY_VERBOSE); $output->writeln('debug', OutputInterface::VERBOSITY_DEBUG); } ``` Commits ------- cedfdc4 Added an example for a different method of verbosity level usage.
xabbuh
added a commit
that referenced
this pull request
Jun 30, 2016
xabbuh
added a commit
that referenced
this pull request
Jun 30, 2016
xabbuh
added a commit
that referenced
this pull request
Jun 30, 2016
* 2.8: [#6597] some tweaks [Validator] Add shorter examples using the default option Typo fix Add missing parameter Updated the CS rule about return null; and return; [#6690] fix syntax error Update date.rst - Fixes typo [#6690] add versionadded directive Added an example for a different method of verbosity level usage. NullOutput should be passed to $command->run() Hard values for the driver option Fix ldap security examples
xabbuh
added a commit
that referenced
this pull request
Jun 30, 2016
* 3.0: [#6597] some tweaks [Validator] Add shorter examples using the default option Typo fix Add missing parameter Updated the CS rule about return null; and return; [#6690] fix syntax error Update date.rst - Fixes typo [#6690] add versionadded directive Added an example for a different method of verbosity level usage. NullOutput should be passed to $command->run() Hard values for the driver option Fix ldap security examples
xabbuh
added a commit
that referenced
this pull request
Jun 30, 2016
* 3.1: [#6597] some tweaks [Validator] Add shorter examples using the default option Typo fix Added the documentation for the Cache component Add missing parameter Updated the CS rule about return null; and return; [#6690] fix syntax error Update date.rst - Fixes typo [#6690] add versionadded directive Added an example for a different method of verbosity level usage. NullOutput should be passed to $command->run() Hard values for the driver option Fix ldap security examples
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Setting a message level like in the added example, was not yet documented. I just found out this method by looking into the code. I also tested with some dummy command that it really does what I thought: