Commit 91f04e9
committed
bug symfony#60055 [MonologBridge] Make
This PR was merged into the 7.3 branch.
Discussion
----------
[MonologBridge] Make `ConsoleHandler` not handle messages at SILENT verbosity
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | symfony#53632
| License | MIT
<details><summary>Original description</summary>
<p>
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.
</p>
</details>
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.
Commits
-------
c7e655d [MonologBridge] Make `ConsoleHandler` not handle messages at SILENT verbosityConsoleHandler not handle messages at SILENT verbosity (okhoshi)File tree
2 files changed
+54
-0
lines changed- src/Symfony/Bridge/Monolog
- Handler
- Tests/Handler
2 files changed
+54
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
104 | 156 | | |
105 | 157 | | |
106 | 158 | | |
| |||
0 commit comments