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

Update LoggingTranslator to log the change of a locale#31242

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:masterfromgmponos:patch-3
Apr 27, 2019

Conversation

@gmponos
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT

I would like to see inside my logs that the translator changed the locale. I've had a case that I spent significant amount of time trying to debug it.

{
$prev =$this->translator->getLocale();
$this->translator->setLocale($locale);
$this->logger->debug('Translator has changed the locale.', ['previous' =>$prev,'new' =>$locale]);
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 it can be usefull in dev

previous/next or old/new, here you use one of both

Choose a reason for hiding this comment

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

It'd suggest putting the locale in the message, e.g.:
The locale of the translator has changed from "%s" to "%s".

@fabpot
Copy link
Member

Thank you@gmponos.

@fabpotfabpot merged commit20380f9 intosymfony:masterApr 27, 2019
fabpot added a commit that referenced this pull requestApr 27, 2019
… (gmponos)This PR was squashed before being merged into the 4.3-dev branch (closes#31242).Discussion----------Update LoggingTranslator to log the change of a locale| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| License       | MITI would like to see inside my logs that the translator changed the locale. I've had a case that I spent significant amount of time trying to debug it.Commits-------20380f9 Update LoggingTranslator to log the change of a locale
@gmponosgmponos deleted the patch-3 branchApril 27, 2019 19:58
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+2 more reviewers

@noniagriconomienoniagriconomienoniagriconomie left review comments

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

6 participants

@gmponos@fabpot@nicolas-grekas@Simperfit@noniagriconomie@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp