[Bridge\Monolog][FrameworkBundle] Add & wire a DebugProcessor#20416
Merged
fabpot merged 1 commit intosymfony:masterfrom Nov 6, 2016
Merged
[Bridge\Monolog][FrameworkBundle] Add & wire a DebugProcessor#20416fabpot merged 1 commit intosymfony:masterfrom
fabpot merged 1 commit intosymfony:masterfrom
Conversation
6f1e17e to
194d36a
Compare
Member
Author
| 'context' => $record['context'], | ||
| 'channel' => isset($record['channel']) ? $record['channel'] : '', | ||
| ); | ||
| switch ($record['level']) { |
Member
There was a problem hiding this comment.
This switch looks unneeded. What about using a simple if?
if (in_array($record['level'], array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY))) {
++$this->errorCount;
}
Member
Author
There was a problem hiding this comment.
Longer line, one array allocation, one function call: not my preference...
Member
There was a problem hiding this comment.
OK then ... but according to 3v4l.org, the if code generates 7 opcodes and the switch code generates 11 opcodes (although it's true that not all opcodes are equal!)
5271fb6 to
3f53985
Compare
3f53985 to
7572a53
Compare
Member
|
Thank you @nicolas-grekas. |
fabpot
added a commit
that referenced
this pull request
Nov 6, 2016
…ocessor (nicolas-grekas) This PR was merged into the 3.2-dev branch. Discussion ---------- [Bridge\Monolog][FrameworkBundle] Add & wire a DebugProcessor | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #20370 | License | MIT | Doc PR | - As identified in #20370, collecting the log records for the profiler should happen before any processor. The only way to do so is by registering a processor to do exactly that. Since the last added processor is called first, this one is wired in a compiler pass that is called after other processors are registered. The DebugHandler class being now useless, it is deprecated. If this approach is accepted, I'll send a PR on monolog bundle & silex to leverage it. Commits ------- 7572a53 [Bridge\Monolog][FrameworkBundle] Add & wire a DebugProcessor
Member
|
@nicolas-grekas Can you make the PRs on the bundle and Silex? Thanks. |
fabpot
added a commit
to silexphp/Silex
that referenced
this pull request
Nov 6, 2016
…le in MonologServiceProvider (nicolas-grekas) This PR was merged into the 2.0.x-dev branch. Discussion ---------- Use DebugProcessor instead of DebugHandler when available in MonologServiceProvider Related to symfony/symfony#20416 Commits ------- 213741a Use DebugProcessor instead of DebugHandler when available in MonologServiceProvider
fabpot
added a commit
to symfony/monolog-bundle
that referenced
this pull request
Nov 6, 2016
…sorPass in FrameworkBundle (nicolas-grekas) This PR was merged into the 2.x branch. Discussion ---------- Deprecate DebugHandlerPass in favor of AddDebugLogProcessorPass in FrameworkBundle Related to symfony/symfony#20416 Commits ------- a55b0a0 Deprecate DebugHandlerPass in favor of AddDebugLogProcessorPass in FrameworkBundle
Merged
Member
|
@nicolas-grekas there is an issue here though: if no handler is handling the record, processors will not be called by Composer |
Member
Author
|
What about making DebugProcessor a null handler then? Or adding a
NullHandler if that's too hacky :)
|
Contributor
|
Not very useful for integration tests of processors 🤔 |
sroze
added a commit
to continuouspipe/continuouspipe
that referenced
this pull request
Jan 7, 2018
sroze
added a commit
to continuouspipe/continuouspipe
that referenced
this pull request
Feb 2, 2018
GromNaN
added a commit
to symfony/monolog-bundle
that referenced
this pull request
Oct 27, 2025
This PR was merged into the 4.x branch. Discussion ---------- Remove support for the `DebugHandler` | Q | A | ------------- | --- | Branch? | 3.x | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT The `DebugHandler` was [removed way back in Symfony 4.0](symfony/symfony#20416). Since the bundle only supports >=6.4, this is no longer needed. This was an oversight in #526. Commits ------- 902cd7f Remove support for the `DebugHandler`
This file contains hidden or 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
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.

As identified in #20370, collecting the log records for the profiler should happen before any processor.
The only way to do so is by registering a processor to do exactly that.
Since the last added processor is called first, this one is wired in a compiler pass that is called after other processors are registered.
The DebugHandler class being now useless, it is deprecated.
If this approach is accepted, I'll send a PR on monolog bundle & silex to leverage it.