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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to