You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2022/03/09 11:39:58 UTC
[GitHub] [sling-org-apache-sling-scripting-core] joerghoh commented on a change in pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
joerghoh commented on a change in pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#discussion_r822560148
##########
File path: src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
##########
@@ -742,13 +746,20 @@ Bindings verifySlingBindings(final SlingBindings slingBindings) throws IOExcepti
LOGGER.trace("Invoking addBindings() of {} took {} nanoseconds",
provider.getClass().getName(), stop-start);
if (stop-start > WARN_LIMIT_FOR_BVP_NANOS) {
- LOGGER.info("Adding the bindings of {} took {} microseconds which is above the harcoded limit of {} microseconds;"
- + " if this message appears often it indicates that this BindingsValuesProvider has an impact on general page rendering performance",
- new Object[]{provider.getClass().getName(), (stop-start)/1000, WARN_LIMIT_FOR_BVP_NANOS/1000});
+ // SLING-11182 - make this work with older implementations of the Sling API
+ if (request != null && request.getRequestProgressTracker() != null) {
+ request.getRequestProgressTracker().log(String.format(BINDINGS_THRESHOLD_MESSAGE, provider.getClass().getName(), (stop-start)/1000, WARN_LIMIT_FOR_BVP_NANOS/1000));
Review comment:
in case a progressTracker is available it just writes the message into the RPT, but not anymore into the logs (as before).
Technically that would count as regression, but I was never really confident with this way of reporting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org