Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LoggingTranslator to log the change of a locale #31242

Merged
merged 1 commit into from Apr 27, 2019

Conversation

Projects
None yet
6 participants
@gmponos
Copy link
Contributor

commented Apr 25, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

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.

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

This comment has been minimized.

Copy link
@noniagriconomie

noniagriconomie Apr 25, 2019

Contributor

+1 it can be usefull in dev

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

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Apr 26, 2019

Member

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

@nicolas-grekas nicolas-grekas added this to the next milestone Apr 26, 2019

@fabpot

fabpot approved these changes Apr 27, 2019

@fabpot fabpot force-pushed the gmponos:patch-3 branch from f4aceff to 20380f9 Apr 27, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Apr 27, 2019

Thank you @gmponos.

@fabpot fabpot merged commit 20380f9 into symfony:master Apr 27, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Apr 27, 2019

feature #31242 Update LoggingTranslator to log the change of a locale…
… (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       | MIT

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.

Commits
-------

20380f9 Update LoggingTranslator to log the change of a locale

@gmponos gmponos deleted the gmponos:patch-3 branch Apr 27, 2019

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019

@fabpot fabpot referenced this pull request May 9, 2019

Merged

Release v4.3.0-BETA1 #31435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.