Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[MonologBridge] MakeConsoleHandler not handle messages at SILENT verbosity#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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@okhoshi
Copy link
Contributor

@okhoshiokhoshi commentedMar 26, 2025
edited by nicolas-grekas
Loading

QA
Branch?7.3
Bug fix?yes
New feature?no
Deprecations?no
Issues#53632
LicenseMIT
Original description

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.

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.

By not handling messages when the ConsoleHandler verbosity is set to silent, the behaviour is more consistent between, Silent and all the other verbosity levels.

@okhoshiokhoshiforce-pushed themonolog-consolehandler-handle-silent branch from5dff435 todbd58bcCompareApril 1, 2025 15:14
Copy link
Member

@nicolas-grekasnicolas-grekas left a 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?

@okhoshiokhoshiforce-pushed themonolog-consolehandler-handle-silent branch fromdbd58bc toc34db51CompareApril 8, 2025 14:20
@okhoshi
Copy link
ContributorAuthor

Are you suggesting this should be enabled by default, but we don't change it because that'd change the existing behavior?

The existing behavior is preserved if the new$handleSilent argument is set to true, hence why it's the default value. But it would be more consistent across the different verbosities if it was set to false.

@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
@okhoshiokhoshiforce-pushed themonolog-consolehandler-handle-silent branch fromc34db51 toa827b61CompareSeptember 2, 2025 09:27
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

I'd rather remove the constructor argument and consider this as a bugfix for#53632
/cc@wouterj WDYT?

@okhoshiokhoshiforce-pushed themonolog-consolehandler-handle-silent branch 2 times, most recently fromcfaf929 to156f97fCompareSeptember 9, 2025 12:47
@okhoshiokhoshi changed the title[MonologBridge] Add$handleSilent constructor argument toConsoleHandler[MonologBridge] MakeConsoleHandler not handle messages at SILENT verbositySep 9, 2025
@okhoshiokhoshi changed the base branch from7.4 to7.3September 9, 2025 12:48
@carsonbotcarsonbot changed the title[MonologBridge] MakeConsoleHandler not handle messages at SILENT verbosity[MonologBridge] MakeConsoleHandler not handle messages at SILENT verbositySep 9, 2025
@okhoshiokhoshiforce-pushed themonolog-consolehandler-handle-silent branch from156f97f toc6bed0cCompareSeptember 9, 2025 13:45
…erbositySigned-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
@okhoshiokhoshiforce-pushed themonolog-consolehandler-handle-silent branch fromc6bed0c toc7e655dCompareSeptember 9, 2025 14:16
@nicolas-grekas
Copy link
Member

Thank you@okhoshi.

@nicolas-grekasnicolas-grekas merged commit91f04e9 intosymfony:7.3Sep 9, 2025
9 of 11 checks passed
@okhoshiokhoshi deleted the monolog-consolehandler-handle-silent branchSeptember 9, 2025 14:30
@wouterj
Copy link
Member

Oh, this indeed was an oversight. The use-case you're describing makes perfect sense, thanks for sending in the fix!

okhoshi reacted with hooray emoji

@fabpotfabpot mentioned this pull requestSep 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@OskarStarkOskarStarkAwaiting requested review from OskarStark

+1 more reviewer

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

7.3

Development

Successfully merging this pull request may close these issues.

7 participants

@okhoshi@nicolas-grekas@wouterj@Tobion@OskarStark@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp