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

[Console] Display errors in quiet mode#18781

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

Closed
multi-io wants to merge6 commits intosymfony:masterfromsyseleven:issue-18767

Conversation

@multi-io
Copy link
Contributor

@multi-iomulti-io commentedMay 13, 2016
edited by nicolas-grekas
Loading

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#18767
LicenseMIT
Doc PR
  • map VERBOSITY_QUIET normally, rather than suppressing all output
    without override
  • ensure that we do write to the output if we've determined (via
    verbosityLevelMap) that we should

About the second point, it seems ConsoleLogger has the same issue (https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Console/Logger/ConsoleLogger.php#L92), but since we're not using that, I haven't checked it.

- map VERBOSITY_QUIET normally, rather than suppressing all output  without override- ensure that we do write to the output if we've determined (via  verbosityLevelMap) that we should
@javiereguiluzjaviereguiluz changed the titlebug #18767 ConsoleHandler output handling fixed[Console] ConsoleHandler output handling fixedMay 18, 2016
// (integration test for the issue #18767 fix)
$levelName = Logger::getLevelName($level);

$realOutput =$this->getMock('Symfony\Component\Console\Output\Output', ['doWrite']);

Choose a reason for hiding this comment

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

array('doWrite')

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedMay 19, 2016
edited
Loading

@multi-io it would be cool if you could also look at fixing ConsoleLogger.php: let's not leave a bug that someone else will hit and spend time on, whereas it's cheap to fix now that we know about it :) thanks

@multi-io
Copy link
ContributorAuthor

@nicolas-grekas ok I've applied the fix to ConsoleLogger too. I've added a ConsoleLogger-specific test that would reproduce the fixed bug.

The"if" query condition in ConsoleLogger's output pipeline that compares input and output verbosity to determine whether the output should take place or not is actually redundant because the output will do the exact same thinginternally. I guess it still makes sense to leave it in because it short-cuts and avoids formatting the output message in the case where we're not going to write it out anyway. But I've added a comment that at least documents this. We might want to remove the if query instead if we regard the small win in code clarity higher than the performance gain. :)

Itmay be advisable to change the default $verbosityLevelMap of ConsoleLogger so that errors and emergencies are output even to a VERBOSITY_QUIET output (which is used e.g. when running a Symfony command with -q -- quite a common thing, and you may not want to suppress all output there). But I'm not sure about Symfony's actual policy regarding this (if any), and it would technically be a breaking change, so I haven't done it.

Previously, ConsoleLogger would always output everything to itsbacking output at the default verbosity (VERBOSITY_NORMAL), whichmeant that if the output had its verbosity setting set toVERBOSITY_QUIET, nothing would ever be output to it, even if theConsoleLogger's verbosityMap specified that some logging levels shouldbe output even to a VERBOSITY_QUIET output.
@nicolas-grekasnicolas-grekas changed the title[Console] ConsoleHandler output handling fixed[Console] Display errors in quiet modeJun 8, 2016
@nicolas-grekas
Copy link
Member

👍, as a feature to me

'->isHandling returns correct value depending on console verbosity and log level'
);

//check that the handler actually outputs the record iff it handles it
Copy link
Member

Choose a reason for hiding this comment

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

if instead of iff

@fabpot
Copy link
Member

👍 for master

@multi-io
Copy link
ContributorAuthor

Thanks for the review. If you don't mind, I'll rewrite the branch history to avoid multiple tiny style fix commits.

@fabpot
Copy link
Member

@multi-io You can squash the commits if you like but just to let you know, we can do it automatically when merging.

@multi-io
Copy link
ContributorAuthor

@fabpot ah, ok. I'll do style commits then.

@multi-io
Copy link
ContributorAuthor

Fixes pushed.

);
}

}
Copy link
Member

Choose a reason for hiding this comment

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

A carriage return must be added after }

@multi-io
Copy link
ContributorAuthor

Sorry, I guess I misunderstood your earlier description. This should be the right fix now.

@fabpot
Copy link
Member

Thank you@multi-io.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@multi-io@nicolas-grekas@fabpot@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp