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
[4.1] Log deprecated only when explicitly requested #31143
Conversation
I would say we should target this for 3.10 (but didn't looked at it now) |
Going forward |
I do not know what a performance of this approach. |
It doesn't automatically solve the issue you're trying to solve. But if Also configuration should be read from configuration file. If |
well, can be, but that problem of that guy who will make it deprecated 😄 |
Yea I already understood what you meant, the same is true if "Log::add" become deprecated, even with |
It's not an edge case. You are adding a broken dependency where there should be no dependencies. As for |
I think that's one of the rare cases we could use |
🤦♂️ |
@SharkyKZ I understood what you talked about, but this does not help to fix anything 😉 As another idea: can try adopt Symfony ErrorHandler somehow (for catch PHP errors/deprecation), but I have no idea how it may work, and whether it will help to avoid performance issue. |
Well,forget all, I try to test how it work, and update PR some time later. |
I don't think this is right. We have a category system specifically to ensure full interopability with other logging systems (also the category system on more complicated sites actually allows a lot of granularity via plugins). If we have performance issues we need to fix them - not hide them away. Has anyone actually tried figuring out what our performance issues are? |
call |
but If you asking why Log::add() become so slow, |
I have changed much stuff, now it better I hope 😄 Also since now, must be used @HLeithner @wilsonge check check upd: it cannot be ported to 3.10, unless this #30317 patch will be ported also |
do we have a chance to have it in, before next beta? :) |
Conflicts: libraries/bootstrap.php
I have tested this item ✅ successfully on 3ccf3aa This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31143. |
I have tested this item ✅ successfully on 3ccf3aa This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31143. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31143. |
I am moving this to 4.1, we are in beta and this is a new feature. Thank you all who have been working on this and bringing it to the state it is now. But if we want to get 4.0 out of the door we need to make a cut. Side note: this decision has be discussed in the production department and the maintainers team. It's not just mine even if I support the decision. |
Conflicts: installation/template/message.php
conflict fixed :) |
Thanks |
* log:logDeprecated * use new log method * new log method, improve callStack lookup * phpcs * phpcs * Check deprecation logging on boot * trigger_error everywhere * use namespaced classes
Summary of Changes
Try to fix performance issue #30997.
I have added proxy methodLog::deprecated()
, to use for deprecation log, which doing log only whenlog_deprecated
is On.However here a little caveats:First: The patch add Application dependency to Log class.
Second: The method may be called when Application is not initialized, then the method will do nothing, such logs may be missed in log output. This affect logs from bootup process. (Actually this is true for all bootup logs)
Use of
trigger_error()
for log for deprecated messages.@wilsonge @HLeithner please review
Testing Instructions
Apply patch.
Enable debug.
In global config enable "Log Deprecated API"
In the debug plugin disable "Log Entries"
Open any page (example /administrator/index.php?option=com_config)
check Debug Bar and note rendering time,
Then in global config disable "Log Deprecated API", refresh the same page,
check Debug Bar and note rendering time,
Actual result BEFORE applying this Pull Request
Debug Bar does not show logs but rendering time still huge.
At administrator/index.php?option=com_config I got around 3s
Expected result AFTER applying this Pull Request
Debug Bar does not show logs and rendering time is smaller.
At administrator/index.php?option=com_config I got around 270ms
Documentation Changes Required
none