X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2FSAMLConfig.cpp;h=f5082b8f0f43665414ee2dd39f58a53b9cae4360;hb=59f6b347e9874943899c59a3c3afc542387604d9;hp=88aa180bd4bfaf29ca2b6a48ae478b601988eba5;hpb=db648eb8d96bd4414060b4a7a59da5a78749d98b;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/SAMLConfig.cpp b/saml/SAMLConfig.cpp index 88aa180..f5082b8 100644 --- a/saml/SAMLConfig.cpp +++ b/saml/SAMLConfig.cpp @@ -22,6 +22,19 @@ */ #include "internal.h" + +#if defined(XMLTOOLING_LOG4SHIB) +# ifndef OPENSAML_LOG4SHIB +# error "Logging library mismatch (XMLTooling is using log4shib)." +# endif +#elif defined(XMLTOOLING_LOG4CPP) +# ifndef OPENSAML_LOG4CPP +# error "Logging library mismatch (XMLTooling is using log4cpp)." +# endif +#else +# error "No supported logging library." +#endif + #include "exceptions.h" #include "SAMLConfig.h" #include "binding/ArtifactMap.h" @@ -37,19 +50,20 @@ #include "saml2/metadata/MetadataProvider.h" #include "util/SAMLConstants.h" +#include #include #include #include +#include -#include #include #include #include using namespace opensaml; using namespace xmlsignature; +using namespace xmltooling::logging; using namespace xmltooling; -using namespace log4cpp; using namespace std; // Expose entry points when used as an extension library @@ -103,10 +117,9 @@ bool SAMLInternalConfig::init(bool initXMLTooling) Category& log=Category::getInstance(SAML_LOGCAT".SAMLConfig"); log.debug("library initialization started"); - if (initXMLTooling) { + if (initXMLTooling) XMLToolingConfig::getConfig().init(); - log.debug("XMLTooling library initialized"); - } + XMLToolingConfig::getConfig().getPathResolver()->setDefaultPackageName("opensaml"); REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ArtifactException,opensaml); REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml); @@ -129,7 +142,7 @@ bool SAMLInternalConfig::init(bool initXMLTooling) registerMessageDecoders(); registerSecurityPolicyRules(); - log.info("library initialization complete"); + log.info("%s library initialization complete", PACKAGE_STRING); return true; } @@ -150,11 +163,10 @@ void SAMLInternalConfig::term(bool termXMLTooling) delete m_artifactMap; m_artifactMap = NULL; - if (termXMLTooling) { + if (termXMLTooling) XMLToolingConfig::getConfig().term(); - log.debug("XMLTooling library shut down"); - } - log.info("library shutdown complete"); + + log.info("%s library shutdown complete", PACKAGE_STRING); } void SAMLInternalConfig::generateRandomBytes(void* buf, unsigned int len)