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 17:14:39 UTC
[GitHub] [sling-org-apache-sling-scripting-core] raducotescu commented on a change in pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
raducotescu commented on a change in pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#discussion_r822891215
##########
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:
I know, but it was a conscious decision - I'd like this logging to be consistent. :D
--
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