[Libreoffice-commits] .: sal/inc xmlsecurity/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 7 07:55:58 PST 2012


 sal/inc/sal/log-areas.dox                                     |    2 
 xmlsecurity/source/xmlsec/nss/nssinitializer.cxx              |   23 ++++++++--
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |    7 ++-
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit 14800ce5f2a23ab45b01a631b9253f7f6f3a7ce5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Nov 7 16:55:20 2012 +0100

    Improve logging
    
    Change-Id: I5ff457c76970356a5748f6f319f32a1f49b86ca1

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 4a603e9..0eadebb 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -200,6 +200,7 @@ certain functionality.
 @section xmlsecurity
 
 @li @c xmlsecurity.dialogs - xml security dialogs
+ at li @c xmlsecurity.xmlsec - xmlsec wrapper
 
 @section other
 
@@ -227,7 +228,6 @@ certain functionality.
 @li @c xmlhelp
 @li @c xmloff
 @li @c xmlreader
- at li @c xmlsecurity
 
 */
 /* vim:set ft=cpp shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
index a694c3f..a1c01d3 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
@@ -53,7 +53,7 @@
 #include <rtl/strbuf.hxx>
 #include <osl/file.hxx>
 #include <osl/thread.h>
-#include <rtl/logfile.hxx>
+#include <sal/log.hxx>
 
 #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 581663b..33a1ea3 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -45,7 +45,7 @@
 #include <cppuhelper/servicefactory.hxx>
 #include <comphelper/docpasswordrequest.hxx>
 #include <xmlsecurity/biginteger.hxx>
-#include <rtl/logfile.h>
+#include <sal/log.hxx>
 #include <com/sun/star/task/InteractionHandler.hpp>
 #include <vector>
 #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


More information about the Libreoffice-commits mailing list