From 14800ce5f2a23ab45b01a631b9253f7f6f3a7ce5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 7 Nov 2012 16:55:20 +0100 Subject: Improve logging Change-Id: I5ff457c76970356a5748f6f319f32a1f49b86ca1 --- xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 23 ++++++++++++++++++---- .../xmlsec/nss/securityenvironment_nssimpl.cxx | 7 +++++-- 2 files changed, 24 insertions(+), 6 deletions(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index a694c3fb9b60..a1c01d304e52 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include "seinitializer_nssimpl.hxx" #include "../diagnose.hxx" @@ -172,7 +172,12 @@ void deleteRootsModule() // first, try to get the profile from "MOZILLA_CERTIFICATE_FOLDER" const char* pEnv = getenv("MOZILLA_CERTIFICATE_FOLDER"); if (pEnv) + { + SAL_INFO( + "xmlsecurity.xmlsec", + "Using Mozilla profile from MOZILLA_CERTIFICATE_FOLDER=" << pEnv); return rtl::OString(pEnv); + } // second, try to get saved user-preference try @@ -181,11 +186,19 @@ void deleteRootsModule() officecfg::Office::Common::Security::Scripting::CertDir::get().get_value_or(rtl::OUString()); if (!sUserSetCertPath.isEmpty()) + { + SAL_INFO( + "xmlsecurity.xmlsec", + "Using Mozilla profile from /org.openoffice.Office.Common/" + "Security/Scripting/CertDir: " << sUserSetCertPath); return rtl::OUStringToOString(sUserSetCertPath, osl_getThreadTextEncoding()); + } } catch (const uno::Exception &e) { - SAL_WARN("xmlsecurity", "getMozillaCurrentProfile: caught exception" << e.Message); + SAL_WARN( + "xmlsecurity.xmlsec", + "getMozillaCurrentProfile: caught exception " << e.Message); } // third, dig around to see if there's one available @@ -211,13 +224,15 @@ void deleteRootsModule() if (!profile.isEmpty()) { rtl::OUString sProfilePath = xMozillaBootstrap->getProfilePath( productTypes[i], profile ); + SAL_INFO( + "xmlsecurity.xmlsec", + "Using Mozilla profile " << sProfilePath); return rtl::OUStringToOString(sProfilePath, osl_getThreadTextEncoding()); } } } - RTL_LOGFILE_PRODUCT_TRACE( "XMLSEC: No Mozilla Profile found!" ); - + SAL_INFO("xmlsecurity.xmlsec", "No Mozilla profile found"); return rtl::OString(); } diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 581663b6ce76..33a1ea3cc223 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include "boost/scoped_array.hpp" @@ -444,7 +444,10 @@ void SecurityEnvironment_NssImpl::updateSlots() if(pSlot != NULL) { - RTL_LOGFILE_TRACE2( "XMLSEC: Found a slot: SlotName=%s, TokenName=%s", PK11_GetSlotName(pSlot), PK11_GetTokenName(pSlot) ); + SAL_INFO( + "xmlsecurity.xmlsec", + "Found a slot: SlotName=" << PK11_GetSlotName(pSlot) + << ", TokenName=" << PK11_GetTokenName(pSlot)); //The following code which is commented out checks if a slot, that is a smart card for example, is // able to generate a symmetric key of type CKM_DES3_CBC. If this fails then this token -- cgit