-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Translation] Added logging capability to translator #10014
Conversation
aitboudad
commented
Jan 13, 2014
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #3015 |
License | MIT |
}, | ||
"suggest": { | ||
"symfony/config": "", | ||
"symfony/yaml": "" | ||
"symfony/yaml": "", | ||
"psr/log": "For using logging capability in translator" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aitboudad
psr/log
contains interfaces only. You need to require some real implementation (most likely monolog/monolog
) to have working logger
Tested on my boxes and these changes add about 3% performance hit on page with ~260 translations:
Why not put all logging into LoggableTranslator and use it instead Translator based on 'kernel.debug' parameter? |
@fabpot What do you think ?? |
@aitboudad Thanks for working on this. Unfortunately, translating methods being called a lot, we cannot add any overhead. Using composition to solve this problem (only in the dev env) is probably the best option (if possible). I'm closing this PR for now. If you want to work on a class that compose existing translator objects, feel free to give it a try and open a new PR. |