-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[MonologBridge] Add $handleSilent
constructor argument to ConsoleHandler
#60055
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
base: 7.4
Are you sure you want to change the base?
Conversation
src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php
Outdated
Show resolved
Hide resolved
5dff435
to
dbd58bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting this should be enabled by default, but we don't change it because that'd change the existing behavior?
…andler` Signed-off-by: Quentin Devos <[email protected]>
dbd58bc
to
c34db51
Compare
The existing behavior is preserved if the new |
Adding a new constructor parameter to ConsoleHandler to let it bubble messages when the output is set at Silent verbosity level (like when using
--silent
in the CLI).Messages are dropped by the ConsoleHandler down the line because of the verbosity, but they are considered as handled and so bubbling is interrupted if the handler is set with
$bubble = false
. The use-case is to have the messages being either printed by the ConsoleHandler (and so seen by the person running the CLI) or sent to the logging system by the next handlers, but not both.Tweaking the
$verbosityLevelMap
is not perfect because EMERGENCY level can never be marked as not handled.With this change, the behaviour is more consistent between Silent and Quiet verbosity levels.