You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:11:53 UTC

[sling-org-apache-sling-scripting-sightly-models-provider] 04/13: improve logging

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 5c29f033e0ebfc303e5bf58176794b6cb52b0531
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri May 13 07:44:26 2016 +0000

    improve logging
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1743611 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/scripting/sightly/models/impl/SlingModelsUseProvider.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
index 78f5667..0ca99a1 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
@@ -122,13 +122,16 @@ public class SlingModelsUseProvider implements UseProvider {
         try {
             // try to instantiate class via Sling Models (first via request, then via resource)
             if (modelFactory.canCreateFromAdaptable(request, cls)) {
+                LOGGER.debug("Trying to instantiate class {} as Sling Model from request.", cls);
                 return ProviderOutcome.notNullOrFailure(modelFactory.createModel(request, cls));
             }
             Resource resource = (Resource) globalBindings.get(SlingBindings.RESOURCE);
             if (resource == null) {
+                LOGGER.debug("Could not get resource from bindings.");
                 return ProviderOutcome.failure(new IllegalStateException("Could not get resource from bindings."));
             }
             if (modelFactory.canCreateFromAdaptable(resource, cls)) {
+                LOGGER.debug("Trying to instantiate class {} as Sling Model from request.", cls);
                 return ProviderOutcome.notNullOrFailure(modelFactory.createModel(resource, cls));
             }
             return ProviderOutcome.failure(

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.