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

[Bridge\Monolog][FrameworkBundle] Add & wire a DebugProcessor#20416

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

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:debug-log-processor
Nov 6, 2016

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?master
Bug fix?yes
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#20370
LicenseMIT
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.

chalasr and ogizanagi reacted with thumbs up emoji
@nicolas-grekas
Copy link
MemberAuthor

Green on CI.
On a project that exhibited the wrong behavior, now fixed:

capture du 2016-11-04 22-47-23

'context' => $record['context'],
'channel' => isset($record['channel']) ? $record['channel'] : '',
);
switch ($record['level']) {
Copy link
Member

Choose a reason for hiding this comment

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

This switch looks unneeded. What about using a simpleif?

if (in_array($record['level'],array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY))) {    ++$this->errorCount;}

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Longer line, one array allocation, one function call: not my preference...

Copy link
Member

Choose a reason for hiding this comment

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

OK then ... but according to 3v4l.org, theif code generates 7 opcodes and theswitch code generates 11 opcodes (although it's true that not all opcodes are equal!)

@nicolas-grekasnicolas-grekasforce-pushed thedebug-log-processor branch 2 times, most recently from5271fb6 to3f53985CompareNovember 5, 2016 09:23
@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit7572a53 intosymfony:masterNov 6, 2016
fabpot added a commit that referenced this pull requestNov 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
@fabpot
Copy link
Member

@nicolas-grekas Can you make the PRs on the bundle and Silex? Thanks.

@nicolas-grekasnicolas-grekas deleted the debug-log-processor branchNovember 6, 2016 10:27
fabpot added a commit to silexphp/Silex that referenced this pull requestNov 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 MonologServiceProviderRelated tosymfony/symfony#20416Commits-------213741a Use DebugProcessor instead of DebugHandler when available in MonologServiceProvider
fabpot added a commit to symfony/monolog-bundle that referenced this pull requestNov 6, 2016
…sorPass in FrameworkBundle (nicolas-grekas)This PR was merged into the 2.x branch.Discussion----------Deprecate DebugHandlerPass in favor of AddDebugLogProcessorPass in FrameworkBundleRelated tosymfony/symfony#20416Commits-------a55b0a0 Deprecate DebugHandlerPass in favor of AddDebugLogProcessorPass in FrameworkBundle
@fabpotfabpot mentioned this pull requestNov 17, 2016
@stof
Copy link
Member

stof commentedJan 2, 2017

@nicolas-grekas there is an issue here though: if no handler is handling the record, processors will not be called by Composer

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedJan 2, 2017 via email

What about making DebugProcessor a null handler then? Or adding aNullHandler if that's too hacky :)

@sroze
Copy link
Contributor

Not very useful for integration tests of processors 🤔

sroze added a commit to continuouspipe/continuouspipe that referenced this pull requestJan 7, 2018
sroze added a commit to continuouspipe/continuouspipe that referenced this pull requestFeb 2, 2018
GromNaN added a commit to symfony/monolog-bundle that referenced this pull requestOct 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       | MITThe `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`
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@nicolas-grekas@fabpot@stof@sroze@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp