Better warnings when rejecting values.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 12 Jun 2003 21:04:59 +0000 (21:04 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 12 Jun 2003 21:04:59 +0000 (21:04 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@500 cb58f699-b61c-0410-a6fe-9272a202ed29

shib/AAP.cpp
shib/ScopedAttribute.cpp

index 7cd128d..e8b169b 100644 (file)
@@ -225,13 +225,17 @@ bool AAP::accept(const XMLCh* name, const XMLCh* originSite, DOMElement* e)
     {
         auto_ptr<char> temp(XMLString::transcode(name));
         auto_ptr<char> temp2(XMLString::transcode(originSite));
-        log.debug("evaluating value for attribute '%s' from site '%s'",temp.get(),temp2.get());
+        log.debug("evaluating value for attribute %s from site %s",temp.get(),temp2.get());
     }
 
     map<xstring,AttributeRule>::const_iterator arule=m_attrMap.find(name);
     if (arule==m_attrMap.end())
     {
-        log.warn("attribute not found in AAP, any value is rejected");
+        if (log.isWarnEnabled())
+        {
+            auto_ptr<char> temp(XMLString::transcode(name));
+            log.warn("attribute %s not found in AAP, any value is rejected",temp.get());
+        }
         return false;
     }
 
@@ -285,7 +289,12 @@ bool AAP::accept(const XMLCh* name, const XMLCh* originSite, DOMElement* e)
     map<xstring,AttributeRule::SiteRule>::const_iterator srule=arule->second.m_siteMap.find(originSite);
     if (srule==arule->second.m_siteMap.end())
     {
-        log.warn("site not found in attribute ruleset, any value is rejected");
+        if (log.isWarnEnabled())
+        {
+            auto_ptr<char> temp(XMLString::transcode(name));
+            auto_ptr<char> temp2(XMLString::transcode(originSite));
+            log.warn("site %s not found in attribute %s ruleset, any value is rejected",temp2.get(),temp.get());
+        }
         return false;
     }
 
@@ -328,6 +337,11 @@ bool AAP::accept(const XMLCh* name, const XMLCh* originSite, DOMElement* e)
             log.warn("implementation does not support XPath value rules");
     }
 
-    log.warn("attribute value could not be validated by AAP, rejecting it");
+    if (log.isWarnEnabled())
+    {
+        auto_ptr<char> temp(XMLString::transcode(name));
+        auto_ptr<char> temp2(XMLString::transcode(n->getNodeValue()));
+        log.warn("attribute %s value {%s} could not be validated by AAP, rejecting it",temp.get(),temp2.get());
+    }
     return false;
 }
index e28e60a..f969c52 100644 (file)
@@ -139,7 +139,8 @@ bool ScopedAttribute::accept(DOMElement* e) const
     if (log.isWarnEnabled())
     {
         auto_ptr<char> tmp(toUTF8(this_scope));
-        log.warn("rejecting value with scope of %s",tmp.get());
+        auto_ptr<char> name(XMLString::transcode(m_name));
+        log.warn("rejecting value for %s with scope of %s",name.get(),tmp.get());
     }
     return false;
 }