[Libreoffice-commits] .: avmedia/source basic/source canvas/inc desktop/source jvmfwk/plugins sal/inc sal/osl sal/prj sal/rtl sfx2/source svl/source sw/source tools/inc tools/source vcl/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Nov 23 06:51:35 PST 2011


 avmedia/source/viewer/mediawindowbase_impl.cxx    |    6 
 basic/source/app/app.cxx                          |    4 
 basic/source/sbx/sbxbase.cxx                      |    6 
 basic/source/uno/namecont.cxx                     |   18 -
 canvas/inc/canvas/verbosetrace.hxx                |    5 
 desktop/source/deployment/registry/dp_backend.cxx |    6 
 jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h   |    8 
 sal/inc/osl/diagnose.h                            |   17 -
 sal/inc/osl/diagnose.hxx                          |    2 
 sal/inc/rtl/string.hxx                            |    2 
 sal/inc/rtl/ustring.hxx                           |    2 
 sal/inc/sal/detail/log.h                          |  111 ++++++
 sal/inc/sal/log.h                                 |  300 ------------------
 sal/inc/sal/log.hxx                               |  263 ++++++++++++++++
 sal/osl/all/log.cxx                               |    3 
 sal/osl/all/logformat.hxx                         |    2 
 sal/osl/all/trace.cxx                             |    3 
 sal/osl/unx/conditn.c                             |  347 ---------------------
 sal/osl/unx/conditn.cxx                           |  360 ++++++++++++++++++++++
 sal/prj/d.lst                                     |    3 
 sal/rtl/source/logfile.cxx                        |    6 
 sfx2/source/appl/module.cxx                       |    4 
 sfx2/source/control/bindings.cxx                  |    6 
 sfx2/source/control/dispatch.cxx                  |    4 
 sfx2/source/control/shell.cxx                     |    6 
 svl/source/items/poolio.cxx                       |    6 
 svl/source/items/whassert.hxx                     |    4 
 sw/source/ui/docvw/srcedtw.cxx                    |    4 
 tools/inc/tools/debug.hxx                         |   31 +
 tools/source/debug/debug.cxx                      |   16 
 tools/source/rc/resmgr.cxx                        |    4 
 vcl/source/app/dbggui.cxx                         |    2 
 32 files changed, 829 insertions(+), 732 deletions(-)

New commits:
commit 0c7bff02710f8ad7915e215f723b6abad0079221
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Nov 23 15:45:43 2011 +0100

    Changed sal/log.h -> sal/log.hxx, drop _S from C++ streaming log macros.
    
    A compile time check ensures the common case of streaming just a plain
    C-style string literal still produces reasonably compact call-site code.
    The format-string variants are still available in sal/detail/log.h, but
    only to be used in obsolete osl/diagnose.h etc., and going to be removed
    again eventually.

diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index 97f36ce..c6b46af 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -31,7 +31,7 @@
 #include "mediamisc.hxx"
 #include "mediawindow.hrc"
 #include <rtl/oustringostreaminserter.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <tools/urlobj.hxx>
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -83,14 +83,14 @@ uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl:
                     xManager->createPlayer( rURL ), uno::UNO_QUERY );
             }
             else
-                SAL_WARN_S(
+                SAL_WARN(
                     "avmedia",
                     ("failed to create media player service "
                      AVMEDIA_MANAGER_SERVICE_NAME));
         }
         catch( const uno::Exception &e )
         {
-            SAL_WARN_S(
+            SAL_WARN(
                 "avmedia",
                 "couldn't create media player " AVMEDIA_MANAGER_SERVICE_NAME
                     ", exception '" << e.Message << '\'');
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 71bde6b..8c93716 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -72,7 +72,7 @@
 
 #include <rtl/oustringostreaminserter.hxx>
 #include <rtl/strbuf.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 
 using namespace comphelper;
 using namespace cppu;
@@ -1852,7 +1852,7 @@ String BasicFrame::GenRealString( const String &aResString )
         }
         else
         {
-            SAL_WARN_S(
+            SAL_WARN(
                 "basic",
                 "Unknown replacement in String: "
                     << rtl::OUString(aResult.Copy(nStart, nEnd - nStart)));
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index fa831ab..d1cf0d5 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -39,7 +39,7 @@
 
 #include <rtl/instance.hxx>
 #include <rtl/oustringostreaminserter.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 
 // AppData-Structure for SBX:
 
@@ -213,7 +213,7 @@ SbxBase* SbxBase::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator )
         if( pNew )
             break;
     }
-    SAL_WARN_IF_S(!pNew, "basic", "No factory for SBX ID " << nSbxId);
+    SAL_WARN_IF(!pNew, "basic", "No factory for SBX ID " << nSbxId);
     return pNew;
 }
 
@@ -227,7 +227,7 @@ SbxObject* SbxBase::CreateObject( const rtl::OUString& rClass )
         if( pNew )
             break;
     }
-    SAL_WARN_IF_S(!pNew, "basic", "No factory for object class " << rClass);
+    SAL_WARN_IF(!pNew, "basic", "No factory for object class " << rClass);
     return pNew;
 }
 
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 5815e61..c8e9608 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -40,7 +40,7 @@
 #include <rtl/oustringostreaminserter.hxx>
 #include <rtl/uri.hxx>
 #include <rtl/strbuf.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/anytostring.hxx>
 
@@ -822,12 +822,12 @@ sal_Bool SfxLibraryContainer::init_Impl(
             }
             catch ( const xml::sax::SAXException& e )
             {
-                SAL_WARN_S("basic", e.Message);
+                SAL_WARN("basic", e.Message);
                 return sal_False;
             }
             catch ( const io::IOException& e )
             {
-                SAL_WARN_S("basic", e.Message);
+                SAL_WARN("basic", e.Message);
                 return sal_False;
             }
 
@@ -915,7 +915,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
                         {
                         #if OSL_DEBUG_LEVEL > 0
                             Any aError( ::cppu::getCaughtException() );
-                            SAL_WARN_S(
+                            SAL_WARN(
                                 "basic",
                                 "couldn't open sub storage for library \""
                                     << rLib.aName << "\". Exception: "
@@ -1405,7 +1405,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
 
             if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
             {
-                SAL_WARN_S(
+                SAL_WARN(
                     "basic",
                     "invalid library element \"" << aElementName << '"');
                 continue;
@@ -1487,7 +1487,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
 
                 if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
                 {
-                    SAL_WARN_S(
+                    SAL_WARN(
                         "basic",
                         "invalid library element \"" << aElementName << '"');
                     continue;
@@ -1904,7 +1904,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
                     {
                     #if OSL_DEBUG_LEVEL > 0
                         Any aError( ::cppu::getCaughtException() );
-                        SAL_WARN_S(
+                        SAL_WARN(
                             "basic",
                             "couldn't create sub storage for library \""
                                 << rLib.aName << "\". Exception: "
@@ -2337,7 +2337,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
             {
             #if OSL_DEBUG_LEVEL > 0
                 Any aError( ::cppu::getCaughtException() );
-                SAL_WARN_S(
+                SAL_WARN(
                     "basic",
                     "couldn't open sub storage for library \"" << Name
                         << "\". Exception: "
@@ -2386,7 +2386,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
 
                 if ( !xInStream.is() )
                 {
-                    SAL_WARN_S(
+                    SAL_WARN(
                         "basic",
                         "couldn't open library element stream - attempted to"
                             " open library \"" << Name << '"');
diff --git a/canvas/inc/canvas/verbosetrace.hxx b/canvas/inc/canvas/verbosetrace.hxx
index 96e12de..f4d2c2e 100644
--- a/canvas/inc/canvas/verbosetrace.hxx
+++ b/canvas/inc/canvas/verbosetrace.hxx
@@ -31,9 +31,10 @@
 
 #include "sal/config.h"
 
-#include "sal/log.h"
+#include "sal/detail/log.h"
 
-#define VERBOSE_TRACE(...) SAL_INFO("canvas.level2", __VA_ARGS__)
+#define VERBOSE_TRACE(...) \
+    SAL_DETAIL_INFO_IF_FORMAT(true, "canvas.level2", __VA_ARGS__)
 
 #endif /* INCLUDED_CANVAS_VERBOSETRACE_HXX */
 
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 13f3a2a..a4c8bc9 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -34,7 +34,7 @@
 #include "rtl/oustringostreaminserter.hxx"
 #include "rtl/uri.hxx"
 #include "rtl/bootstrap.hxx"
-#include "sal/log.h"
+#include "sal/log.hxx"
 #include "osl/file.hxx"
 #include "cppuhelper/exc_hlp.hxx"
 #include "comphelper/servicedecl.hxx"
@@ -75,7 +75,7 @@ void PackageRegistryBackend::disposing( lang::EventObject const & event )
     ::osl::MutexGuard guard( getMutex() );
     if ( m_bound.erase( url ) != 1 )
     {
-        SAL_WARN_S("basic", "erase(" << url << ") != 1");
+        SAL_WARN("basic", "erase(" << url << ") != 1");
     }
 }
 
@@ -681,7 +681,7 @@ void Package::processPackage_impl(
             }
         }
         catch (RuntimeException &e) {
-            SAL_WARN_S(
+            SAL_WARN(
                 "basic", "unexpected RuntimeException \"" << e.Message << '"');
             throw;
         }
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h
index eb1cd03..fd6b5f3 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h
+++ b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h
@@ -32,13 +32,13 @@
 #include "sal/config.h"
 
 #include "rtl/oustringostreaminserter.hxx"
-#include "sal/log.h"
+#include "sal/log.hxx"
 
-#define JFW_ENSURE(c, m) SAL_WARN_IF_S(!(c), "jfw", m)
+#define JFW_ENSURE(c, m) SAL_WARN_IF(!(c), "jfw", m)
 
-#define JFW_TRACE0(m) SAL_INFO_S("jfw.level1", m)
+#define JFW_TRACE0(m) SAL_INFO("jfw.level1", m)
 
-#define JFW_TRACE2(m) SAL_INFO_S("jfw.level2", m);
+#define JFW_TRACE2(m) SAL_INFO("jfw.level2", m);
 
 #endif
 
diff --git a/sal/inc/osl/diagnose.h b/sal/inc/osl/diagnose.h
index 0e1fc44..12357aa 100644
--- a/sal/inc/osl/diagnose.h
+++ b/sal/inc/osl/diagnose.h
@@ -32,7 +32,7 @@
 
 #include "sal/config.h"
 
-#include <sal/log.h>
+#include <sal/detail/log.h>
 #include <sal/types.h>
 
 /** provides simple diagnostic support
@@ -42,7 +42,7 @@
     if an assertion fails, and is controlled by the standard NDEBUG macro).
     Logging of warnings (e.g., about malformed input) and traces (e.g., about
     steps taken while executing some protocol) should use the facilities
-    provided by sal/log.h.
+    provided by (C++ only) sal/log.hxx.
 
     Because the assertion macros (OSL_ASSERT, OSL_ENSURE, OSL_FAIL, OSL_PRECOND,
     and OSL_POSTCOND) have been used for true assertions as well as for logged
@@ -139,19 +139,20 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf
 
 /* the macro OSL_LOG_PREFIX is intended to be an office internal macro for now
 
-   it is deprecated and superseded by SAL_WHERE
+   it is deprecated and superseded by (C++ only) SAL_WHERE
 */
-#define OSL_LOG_PREFIX SAL_WHERE
+#define OSL_LOG_PREFIX SAL_DETAIL_WHERE
 
 #define OSL_DEBUG_ONLY(s)   _OSL_DEBUG_ONLY(s)
 
 #define OSL_TRACE(...) \
-    SAL_INFO_IF(OSL_DEBUG_LEVEL > 0, "legacy.osl", __VA_ARGS__)
+    SAL_DETAIL_INFO_IF_FORMAT(OSL_DEBUG_LEVEL > 0, "legacy.osl", __VA_ARGS__)
 
 #if OSL_DEBUG_LEVEL > 0
-#define OSL_ASSERT(c) SAL_WARN_IF(!(c), "legacy.osl", "OSL_ASSERT")
-#define OSL_ENSURE(c, m) SAL_WARN_IF(!(c), "legacy.osl", "%s", m)
-#define OSL_FAIL(m) SAL_WARN_IF(sal_True, "legacy.osl", "%s", m)
+#define OSL_ASSERT(c) \
+    SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "OSL_ASSERT")
+#define OSL_ENSURE(c, m) SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "%s", m)
+#define OSL_FAIL(m) SAL_DETAIL_WARN_IF_FORMAT(sal_True, "legacy.osl", "%s", m)
 #else
 #define OSL_ASSERT(c) ((void) 0)
 #define OSL_ENSURE(c, m) ((void) 0)
diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx
index 42e4b8d..45a6fdd 100644
--- a/sal/inc/osl/diagnose.hxx
+++ b/sal/inc/osl/diagnose.hxx
@@ -39,7 +39,7 @@
 #include "osl/mutex.hxx"
 #include "rtl/allocator.hxx"
 #include "rtl/instance.hxx"
-#include "sal/log.h"
+#include "sal/log.hxx"
 #include "sal/types.h"
 
 namespace osl {
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 007129a..0db8341 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -37,7 +37,7 @@
 #include <rtl/memory.h>
 #include <rtl/textenc.h>
 #include <rtl/string.h>
-#include "sal/log.h"
+#include "sal/log.hxx"
 
 #if !defined EXCEPTIONS_OFF
 #include <new>
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index ef13dd1..868f6dd 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -37,7 +37,7 @@
 #include <rtl/ustring.h>
 #include <rtl/string.hxx>
 #include <rtl/memory.h>
-#include "sal/log.h"
+#include "sal/log.hxx"
 
 #if defined EXCEPTIONS_OFF
 #include <stdlib.h>
diff --git a/sal/inc/sal/detail/log.h b/sal/inc/sal/detail/log.h
new file mode 100644
index 0000000..bc51b89
--- /dev/null
+++ b/sal/inc/sal/detail/log.h
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Stephan Bergmann, Red Hat <sbergman at redhat.com> (initial
+ *   developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef INCLUDED_SAL_DETAIL_LOG_H
+#define INCLUDED_SAL_DETAIL_LOG_H
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+/** @internal */
+
+/* This header makes available replacements working in both C and C++ for the
+   obsolete osl/diagnose.h functionality that in turn is used from both C and
+   C++ code and the obsolete tools/debug.hxx and
+   canvas/inc/canvas/verbosetrace.hxx functionality that uses printf-style
+   formatting.  Once that obsolete functionality is removed, this header can be
+   removed, too.
+
+   This header uses variadic macros in both C (where they are officially only
+   supported since C99) and C++ (where they are officially only supported since
+   C++11).  It appears that all relevant compilers (esp. GCC 4.0 and MS VS 2008
+   Express) already support them in their C and C++ dialects.  See also
+   <http://wiki.apache.org/stdcxx/C++0xCompilerSupport>.
+
+   Avoid the use of other sal code in this header as much as possible, so that
+   this code can be called from other sal code without causing endless
+   recursion.
+*/
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+enum sal_detail_LogLevel {
+    SAL_DETAIL_LOG_LEVEL_INFO, SAL_DETAIL_LOG_LEVEL_WARN,
+    SAL_DETAIL_MAKE_FIXED_SIZE = SAL_MAX_ENUM
+};
+
+void SAL_CALL sal_detail_logFormat(
+    enum sal_detail_LogLevel level, char const * area, char const * where,
+    char const * format, ...)
+/* TODO: enabling this will produce a huge amount of -Werror=format errors: */
+#if defined GCC && 0
+    __attribute__((format(printf, 4, 5)))
+#endif
+    ;
+
+#if defined __cplusplus
+}
+#endif
+
+#define SAL_DETAIL_LOG_FORMAT(condition, level, area, where, ...) \
+    do { \
+        if (condition) { \
+            sal_detail_logFormat((level), (area), (where), __VA_ARGS__); \
+        } \
+    } while (sal_False)
+
+#if defined SAL_LOG_INFO
+#define SAL_DETAIL_ENABLE_LOG_INFO sal_True
+#else
+#define SAL_DETAIL_ENABLE_LOG_INFO sal_False
+#endif
+#if defined SAL_LOG_WARN
+#define SAL_DETAIL_ENABLE_LOG_WARN sal_True
+#else
+#define SAL_DETAIL_ENABLE_LOG_WARN sal_False
+#endif
+
+#define SAL_DETAIL_WHERE __FILE__ ":" SAL_STRINGIFY(__LINE__) ": "
+
+#define SAL_DETAIL_INFO_IF_FORMAT(condition, area, ...) \
+    SAL_DETAIL_LOG_FORMAT( \
+        SAL_DETAIL_ENABLE_LOG_INFO && (condition), SAL_DETAIL_LOG_LEVEL_INFO, \
+        area, SAL_DETAIL_WHERE, __VA_ARGS__)
+
+#define SAL_DETAIL_WARN_IF_FORMAT(condition, area, ...) \
+    SAL_DETAIL_LOG_FORMAT( \
+        SAL_DETAIL_ENABLE_LOG_WARN && (condition), SAL_DETAIL_LOG_LEVEL_WARN, \
+        area, SAL_DETAIL_WHERE, __VA_ARGS__)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/inc/sal/log.h b/sal/inc/sal/log.h
deleted file mode 100644
index d63ed6b..0000000
--- a/sal/inc/sal/log.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * Version: MPL 1.1 / GPLv3+ / LGPLv3+
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License or as specified alternatively below. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Major Contributor(s):
- * [ Copyright (C) 2011 Stephan Bergmann, Red Hat <sbergman at redhat.com> (initial
- *   developer) ]
- *
- * All Rights Reserved.
- *
- * For minor contributions see the git repository.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-
-#ifndef INCLUDED_SAL_LOG_H
-#define INCLUDED_SAL_LOG_H
-
-#include "sal/config.h"
-
-#if defined __cplusplus
-#include <sstream>
-#include <string>
-#endif
-
-#include "sal/types.h"
-
-/* This header uses variadic macros in both C (where they are officially only
-   supported since C99) and C++ (where they are officially only supported since
-   C++11).  It appears that all relevant compilers (esp. GCC 4.0 and MS VS 2008
-   Express) already support them in their C and C++ dialects.  See also
-   <http://wiki.apache.org/stdcxx/C++0xCompilerSupport>.
-
-   Avoid the use of other sal code in this header as much as possible, so that
-   this code can be called from other sal code without causing endless
-   recursion.
-*/
-
-#if defined __cplusplus
-extern "C" {
-#endif
-
-/** @internal */
-enum sal_detail_LogLevel {
-    SAL_DETAIL_LOG_LEVEL_INFO, SAL_DETAIL_LOG_LEVEL_WARN,
-    SAL_DETAIL_MAKE_FIXED_SIZE = SAL_MAX_ENUM
-};
-
-/** @internal */
-void SAL_CALL sal_detail_log(
-    enum sal_detail_LogLevel level, char const * area, char const * where,
-    char const * message);
-
-/** @internal */
-void SAL_CALL sal_detail_logFormat(
-    enum sal_detail_LogLevel level, char const * area, char const * where,
-    char const * format, ...)
-/* TODO: enabling this will produce a huge amount of -Werror=format errors: */
-#if defined GCC && 0
-    __attribute__((format(printf, 4, 5)))
-#endif
-    ;
-
-#if defined __cplusplus
-}
-#endif
-
-/** @internal */
-#define SAL_DETAIL_LOG_FORMAT(condition, level, area, where, ...) \
-    do { \
-        if (condition) { \
-            sal_detail_logFormat((level), (area), (where), __VA_ARGS__); \
-        } \
-    } while (sal_False)
-
-#if defined __cplusplus
-
-namespace sal { namespace detail {
-
-/// @internal
-inline void SAL_CALL log(
-    sal_detail_LogLevel level, char const * area, char const * where,
-    std::ostringstream const & stream)
-{
-    // An alternative would be to have sal_detail_log take a std::ostringstream
-    // pointer (via a C void pointer); the advantage would be smaller client
-    // code (the ".str().c_str()" part would move into the implementation of
-    // sal_detail_log) and potential for proper support of embedded null
-    // characters within the message, but the disadvantage would be dependence
-    // on the C++ ABI; as a compromise, the ".str().c_str()" part has been moved
-    // to this inline function so that it is potentially only emitted once per
-    // dynamic library:
-    sal_detail_log(level, area, where, stream.str().c_str());
-}
-
-} }
-
-/// @internal
-#define SAL_DETAIL_LOG_STREAM(condition, level, area, where, stream) \
-    do { \
-        if (condition) { \
-            ::std::ostringstream sal_detail_stream; \
-            sal_detail_stream << stream; \
-            ::sal::detail::log((level), (area), (where), sal_detail_stream); \
-        } \
-    } while (false)
-
-#endif
-
-/** @internal */
-#if defined SAL_LOG_INFO
-#define SAL_DETAIL_ENABLE_LOG_INFO sal_True
-#else
-#define SAL_DETAIL_ENABLE_LOG_INFO sal_False
-#endif
-#if defined SAL_LOG_WARN
-#define SAL_DETAIL_ENABLE_LOG_WARN sal_True
-#else
-#define SAL_DETAIL_ENABLE_LOG_WARN sal_False
-#endif
-
-/** A simple macro to create a "file and line number" string.
-
-    Potentially not only useful within the log framework (where it is used
-    automatically), but also when creating exception messages.
-
-    @since LibreOffice 3.5
-*/
-#define SAL_WHERE __FILE__ ":" SAL_STRINGIFY(__LINE__) ": "
-
-#if defined __cplusplus
-
-/** A facility for generating temporary string messages by piping items into a
-    C++ std::ostringstream.
-
-    This can be useful for example in a call to SAL_INFO_S when depending on
-    some boolean condition data of incompatible types shall be streamed into the
-    message, as in:
-
-      SAL_INFO_S(
-        "foo", "object: " << (hasName ? obj->name : SAL_STREAM(obj)));
-
-    @since LibreOffice 3.5
-*/
-#define SAL_STREAM(stream) \
-    (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream). \
-     str())
-
-#endif
-
-/** Basic logging functionality.
-
-    SAL_INFO(char const * area, char const * format, ...),
-    SAL_INFO_IF(bool condition, char const * area, char const * format, ...),
-    SAL_WARN(char const * area, char const * format, ...), and
-    SAL_WARN_IF(bool condition, char const * area, char const * format, ...)
-    produce an info resp. warning log entry with a printf-style message.  The
-    given format argument and any following arguments must be so that that
-    sequence of arguments would be appropriate for a call to printf.
-
-    SAL_INFO_S(char const * area, expr),
-    SAL_INFO_IF_S(bool condition, char const * area, expr),
-    SAL_WARN_S(char const * area, expr), and
-    SAL_WARN_IF_S(bool condition, char const * area, expr) produce an info resp.
-    warning log entry with a message produced by piping items into a C++
-    std::ostringstream (and are only available in C++).  The given expr must be
-    so that the full expression "stream << expr" is valid, where stream is a
-    variable of type std::ostringstream.
-
-      SAL_INFO_S("foo", "string " << s << " of length " << n)
-
-    would be an example of such a call; if the given s is of type rtl::OUString,
-
-      #include "rtl/oustringostreaminserter.hxx"
-
-    would make sure that an appropriate operator << is available.
-
-    In either case, the composed message should be in UTF-8 and it should
-    contain no vertical formatting characters and no null characters
-
-    For the _IF variants, log output is only generated if the given condition is
-    true (in addition to the other conditions that have to be met).
-
-    For all these macros, the given area argument must be non-null and must
-    match the regular expression
-
-      <area> ::= <segment>("."<segment>)*
-
-    with
-
-      <segment> ::= [0-9a-z]+
-
-    Whether these macros generate any log output is controlled in a two-stage
-    process.
-
-    First, at compile time the macros SAL_LOG_INFO and SAL_LOG_WARN,
-    respectively, control whether the INFO and WARN macros, respectively,
-    expand to actual code (in case the macro is defined, to any value) or to
-    no-ops (in case the macro is not defined).
-
-    Second, at runtime the environment variable SAL_LOG further limits which
-    macro calls actually generate log output.  The environment variable SAL_LOG
-    must either be unset or must match the regular expression
-
-      <env> ::= <switch>*
-
-    with
-
-      <switch> ::= <sense><level>("."<area>)?
-      <sense> ::= "+"|"-"
-      <level> ::= "INFO"|"WARN"
-
-    If the environment variable is unset, "+WARN" is used instead (which results
-    in all warnings being output but no infos).  If the given value does not
-    match the regular expression, "+INFO+WARN" is used instead (which in turn
-    results in everything being output).
-
-    A given macro call's level (INFO or WARN) and area is matched against the
-    given switches as follows:  Only those switches for which the level matches
-    the given level and for which the area is a prefix (including both empty and
-    full prefixes) of the given area are considered.  Log output is generated if
-    and only if among the longest such switches (if any), there is at least one
-    that has a sense of "+".  (That is, if both +INFO.foo and -INFO.foo are
-    present, +INFO.foo wins.)
-
-    For example, if SAL_LOG is "+INFO-INFO.foo+INFO.foo.bar", then calls like
-    SAL_INFO("foo.bar", ...), SAL_INFO("foo.bar.baz", ...), or
-    SAL_INFO("other", ...) generate output, while calls like
-    SAL_INFO("foo", ...) or SAL_INFO("foo.barzzz", ...) do not.
-
-    The generated log output consists of the given level ("info" or "warn"), the
-    given area, the process ID, the thread ID, the source file, and the source
-    line number, each followed by a colon, followed by a space, the given
-    message, and a newline.  The precise format of the log output is subject to
-    change.  The log output is printed to stderr without further text encoding
-    conversion.
-
-    @since LibreOffice 3.5
-*/
-
-#define SAL_INFO(area, ...) \
-    SAL_DETAIL_LOG_FORMAT( \
-        SAL_DETAIL_ENABLE_LOG_INFO, SAL_DETAIL_LOG_LEVEL_INFO, area, \
-        SAL_WHERE, __VA_ARGS__)
-
-#define SAL_INFO_IF(condition, area, ...) \
-    SAL_DETAIL_LOG_FORMAT( \
-        SAL_DETAIL_ENABLE_LOG_INFO && (condition), SAL_DETAIL_LOG_LEVEL_INFO, \
-        area, SAL_WHERE, __VA_ARGS__)
-
-#define SAL_WARN(area, ...) \
-    SAL_DETAIL_LOG_FORMAT( \
-        SAL_DETAIL_ENABLE_LOG_WARN, SAL_DETAIL_LOG_LEVEL_WARN, area, \
-        SAL_WHERE, __VA_ARGS__)
-
-#define SAL_WARN_IF(condition, area, ...) \
-    SAL_DETAIL_LOG_FORMAT( \
-        SAL_DETAIL_ENABLE_LOG_WARN && (condition), SAL_DETAIL_LOG_LEVEL_WARN, \
-        area, SAL_WHERE, __VA_ARGS__)
-
-#if defined __cplusplus
-
-#define SAL_INFO_S(area, stream) \
-    SAL_DETAIL_LOG_STREAM( \
-        SAL_DETAIL_ENABLE_LOG_INFO, ::SAL_DETAIL_LOG_LEVEL_INFO, area, \
-        SAL_WHERE, stream)
-
-#define SAL_INFO_IF_S(condition, area, stream)  \
-    SAL_DETAIL_LOG_STREAM( \
-        SAL_DETAIL_ENABLE_LOG_INFO && (condition), \
-        ::SAL_DETAIL_LOG_LEVEL_INFO, area, SAL_WHERE, stream)
-
-#define SAL_WARN_S(area, stream) \
-    SAL_DETAIL_LOG_STREAM( \
-        SAL_DETAIL_ENABLE_LOG_WARN, ::SAL_DETAIL_LOG_LEVEL_WARN, area, \
-        SAL_WHERE, stream)
-
-#define SAL_WARN_IF_S(condition, area, stream)   \
-    SAL_DETAIL_LOG_STREAM( \
-        SAL_DETAIL_ENABLE_LOG_WARN && (condition), \
-        ::SAL_DETAIL_LOG_LEVEL_WARN, area, SAL_WHERE, stream)
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/inc/sal/log.hxx b/sal/inc/sal/log.hxx
new file mode 100644
index 0000000..be71d02
--- /dev/null
+++ b/sal/inc/sal/log.hxx
@@ -0,0 +1,263 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Stephan Bergmann, Red Hat <sbergman at redhat.com> (initial
+ *   developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef INCLUDED_SAL_LOG_HXX
+#define INCLUDED_SAL_LOG_HXX
+
+#include "sal/config.h"
+
+#include <cstdlib>
+#include <sstream>
+#include <string>
+
+#include "sal/detail/log.h"
+#include "sal/types.h"
+
+// Avoid the use of other sal code in this header as much as possible, so that
+// this code can be called from other sal code without causing endless
+// recursion.
+
+/// @internal
+extern "C" void SAL_CALL sal_detail_log(
+    enum sal_detail_LogLevel level, char const * area, char const * where,
+    char const * message);
+
+/// @internal
+namespace sal { namespace detail {
+
+inline void SAL_CALL log(
+    sal_detail_LogLevel level, char const * area, char const * where,
+    std::ostringstream const & stream)
+{
+    // An alternative would be to have sal_detail_log take a std::ostringstream
+    // pointer (via a C void pointer); the advantage would be smaller client
+    // code (the ".str().c_str()" part would move into the implementation of
+    // sal_detail_log) and potential for proper support of embedded null
+    // characters within the message, but the disadvantage would be dependence
+    // on the C++ ABI; as a compromise, the ".str().c_str()" part has been moved
+    // to this inline function so that it is potentially only emitted once per
+    // dynamic library:
+    sal_detail_log(level, area, where, stream.str().c_str());
+}
+
+// Special handling of the common case where the message consists of just a
+// string literal, to produce smaller call-site code:
+
+struct StreamStart {};
+
+struct StreamString {
+    StreamString(char const * s): string(s) {}
+
+    char const * string;
+
+    typedef char Result;
+};
+
+struct StreamIgnore {
+    typedef struct { char a[2]; } Result;
+};
+
+inline StreamString operator <<(StreamStart const &, char const * s) {
+    return StreamString(s);
+}
+
+template< typename T > inline StreamIgnore operator <<(
+    StreamStart const &, T const &)
+{
+    std::abort();
+}
+
+template< typename T > inline StreamIgnore operator <<(
+    StreamString const &, T const &)
+{
+    std::abort();
+}
+
+template< typename T > inline StreamIgnore operator <<(
+    StreamIgnore const &, T const &)
+{
+    std::abort();
+}
+
+template< typename T > typename T::Result getResult(T const &);
+
+inline char const * unwrapStream(StreamString const & s) { return s.string; }
+
+inline char const * unwrapStream(StreamIgnore const &) { std::abort(); }
+
+} }
+
+/// @internal
+#define SAL_DETAIL_LOG_STREAM(condition, level, area, where, stream) \
+    do { \
+        if (condition) { \
+            if (sizeof getResult(::sal::detail::StreamStart() << stream) == 1) \
+            { \
+                ::sal_detail_log( \
+                    (level), (area), (where), \
+                    ::sal::detail::unwrapStream( \
+                        ::sal::detail::StreamStart() << stream)); \
+            } else { \
+                ::std::ostringstream sal_detail_stream; \
+                sal_detail_stream << stream; \
+                ::sal::detail::log( \
+                    (level), (area), (where), sal_detail_stream); \
+            } \
+        } \
+    } while (false)
+
+/** A simple macro to create a "file and line number" string.
+
+    Potentially not only useful within the log framework (where it is used
+    automatically), but also when creating exception messages.
+
+    @since LibreOffice 3.5
+*/
+#define SAL_WHERE SAL_DETAIL_WHERE
+
+/** A facility for generating temporary string messages by piping items into a
+    C++ std::ostringstream.
+
+    This can be useful for example in a call to SAL_INFO when depending on some
+    boolean condition data of incompatible types shall be streamed into the
+    message, as in:
+
+      SAL_INFO("foo", "object: " << (hasName ? obj->name : SAL_STREAM(obj)));
+
+    @since LibreOffice 3.5
+*/
+#define SAL_STREAM(stream) \
+    (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream). \
+     str())
+
+/** Basic logging functionality.
+
+    SAL_INFO(char const * area, expr),
+    SAL_INFO_IF(bool condition, char const * area, expr),
+    SAL_WARN(char const * area, expr), and
+    SAL_WARN_IF(bool condition, char const * area, expr) produce an info resp.
+    warning log entry with a message produced by piping items into a C++
+    std::ostringstream.  The given expr must be so that the full expression
+    "stream << expr" is valid, where stream is a variable of type
+    std::ostringstream.
+
+      SAL_INFO("foo", "string " << s << " of length " << n)
+
+    would be an example of such a call; if the given s is of type rtl::OUString,
+
+      #include "rtl/oustringostreaminserter.hxx"
+
+    would make sure that an appropriate operator << is available.
+
+    In either case, the composed message should be in UTF-8 and it should
+    contain no vertical formatting characters and no null characters
+
+    For the _IF variants, log output is only generated if the given condition is
+    true (in addition to the other conditions that have to be met).
+
+    For all these macros, the given area argument must be non-null and must
+    match the regular expression
+
+      <area> ::= <segment>("."<segment>)*
+
+    with
+
+      <segment> ::= [0-9a-z]+
+
+    Whether these macros generate any log output is controlled in a two-stage
+    process.
+
+    First, at compile time the macros SAL_LOG_INFO and SAL_LOG_WARN,
+    respectively, control whether the INFO and WARN macros, respectively,
+    expand to actual code (in case the macro is defined, to any value) or to
+    no-ops (in case the macro is not defined).
+
+    Second, at runtime the environment variable SAL_LOG further limits which
+    macro calls actually generate log output.  The environment variable SAL_LOG
+    must either be unset or must match the regular expression
+
+      <env> ::= <switch>*
+
+    with
+
+      <switch> ::= <sense><level>("."<area>)?
+      <sense> ::= "+"|"-"
+      <level> ::= "INFO"|"WARN"
+
+    If the environment variable is unset, "+WARN" is used instead (which results
+    in all warnings being output but no infos).  If the given value does not
+    match the regular expression, "+INFO+WARN" is used instead (which in turn
+    results in everything being output).
+
+    A given macro call's level (INFO or WARN) and area is matched against the
+    given switches as follows:  Only those switches for which the level matches
+    the given level and for which the area is a prefix (including both empty and
+    full prefixes) of the given area are considered.  Log output is generated if
+    and only if among the longest such switches (if any), there is at least one
+    that has a sense of "+".  (That is, if both +INFO.foo and -INFO.foo are
+    present, +INFO.foo wins.)
+
+    For example, if SAL_LOG is "+INFO-INFO.foo+INFO.foo.bar", then calls like
+    SAL_INFO("foo.bar", ...), SAL_INFO("foo.bar.baz", ...), or
+    SAL_INFO("other", ...) generate output, while calls like
+    SAL_INFO("foo", ...) or SAL_INFO("foo.barzzz", ...) do not.
+
+    The generated log output consists of the given level ("info" or "warn"), the
+    given area, the process ID, the thread ID, the source file, and the source
+    line number, each followed by a colon, followed by a space, the given
+    message, and a newline.  The precise format of the log output is subject to
+    change.  The log output is printed to stderr without further text encoding
+    conversion.
+
+    @since LibreOffice 3.5
+*/
+
+#define SAL_INFO(area, stream) \
+    SAL_DETAIL_LOG_STREAM( \
+        SAL_DETAIL_ENABLE_LOG_INFO, ::SAL_DETAIL_LOG_LEVEL_INFO, area, \
+        SAL_WHERE, stream)
+
+#define SAL_INFO_IF(condition, area, stream)  \
+    SAL_DETAIL_LOG_STREAM( \
+        SAL_DETAIL_ENABLE_LOG_INFO && (condition), \
+        ::SAL_DETAIL_LOG_LEVEL_INFO, area, SAL_WHERE, stream)
+
+#define SAL_WARN(area, stream) \
+    SAL_DETAIL_LOG_STREAM( \
+        SAL_DETAIL_ENABLE_LOG_WARN, ::SAL_DETAIL_LOG_LEVEL_WARN, area, \
+        SAL_WHERE, stream)
+
+#define SAL_WARN_IF(condition, area, stream)   \
+    SAL_DETAIL_LOG_STREAM( \
+        SAL_DETAIL_ENABLE_LOG_WARN && (condition), \
+        ::SAL_DETAIL_LOG_LEVEL_WARN, area, SAL_WHERE, stream)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index be45cf6..a439644 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -42,7 +42,8 @@
 
 #include "osl/thread.hxx"
 #include "rtl/string.h"
-#include "sal/log.h"
+#include "sal/detail/log.h"
+#include "sal/log.hxx"
 #include "sal/types.h"
 
 #include "logformat.hxx"
diff --git a/sal/osl/all/logformat.hxx b/sal/osl/all/logformat.hxx
index f4589a7..bb6ea4c 100644
--- a/sal/osl/all/logformat.hxx
+++ b/sal/osl/all/logformat.hxx
@@ -34,7 +34,7 @@
 
 #include <cstdarg>
 
-#include "sal/log.h"
+#include "sal/detail/log.h"
 
 namespace osl { namespace detail {
 
diff --git a/sal/osl/all/trace.cxx b/sal/osl/all/trace.cxx
index 8357047..8fccb44 100644
--- a/sal/osl/all/trace.cxx
+++ b/sal/osl/all/trace.cxx
@@ -33,7 +33,8 @@
 #include <cstdarg>
 
 #include "osl/diagnose.h"
-#include "sal/log.h"
+#include "sal/detail/log.h"
+#include "sal/log.hxx"
 
 #include "logformat.hxx"
 
diff --git a/sal/osl/unx/conditn.c b/sal/osl/unx/conditn.c
deleted file mode 100644
index d7ab713..0000000
--- a/sal/osl/unx/conditn.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "sal/config.h"
-
-#include <assert.h>
-
-#include "system.h"
-#include <sal/log.h>
-#include <sal/types.h>
-
-#include <osl/conditn.h>
-#include <osl/time.h>
-
-
-typedef struct _oslConditionImpl
-{
-    pthread_cond_t  m_Condition;
-    pthread_mutex_t m_Lock;
-    sal_Bool            m_State;
-} oslConditionImpl;
-
-
-/*****************************************************************************/
-/* osl_createCondition */
-/*****************************************************************************/
-oslCondition SAL_CALL osl_createCondition()
-{
-      oslConditionImpl* pCond;
-    int nRet=0;
-
-    pCond = (oslConditionImpl*) malloc(sizeof(oslConditionImpl));
-
-    if ( pCond == 0 )
-    {
-        SAL_WARN("sal", "std::bad_alloc in C");
-        return 0;
-    }
-
-    pCond->m_State = sal_False;
-
-    /* init condition variable with default attr. (PTHREAD_PROCESS_PRIVAT) */
-    nRet =  pthread_cond_init(&pCond->m_Condition, PTHREAD_CONDATTR_DEFAULT);
-    if ( nRet != 0 )
-    {
-        SAL_WARN(
-            "sal", "pthread_cond_init failed, errno %d, \"%s\"", nRet,
-            strerror(nRet));
-
-        free(pCond);
-        return 0;
-    }
-
-    nRet = pthread_mutex_init(&pCond->m_Lock, PTHREAD_MUTEXATTR_DEFAULT);
-    if ( nRet != 0 )
-    {
-        SAL_WARN(
-            "sal", "pthread_mutex_init failed, errno %d, \"%s\"", nRet,
-            strerror(nRet));
-
-        nRet = pthread_cond_destroy(&pCond->m_Condition);
-        SAL_WARN_IF(
-            nRet != 0, "sal", "pthread_cond_destroy failed, errno %d, \"%s\"",
-            nRet, strerror(nRet));
-
-        free(pCond);
-        pCond = 0;
-    }
-
-    return (oslCondition)pCond;
-}
-
-/*****************************************************************************/
-/* osl_destroyCondition */
-/*****************************************************************************/
-void SAL_CALL osl_destroyCondition(oslCondition Condition)
-{
-    oslConditionImpl* pCond;
-    int nRet = 0;
-
-    if ( Condition )
-    {
-        pCond = (oslConditionImpl*)Condition;
-
-        nRet = pthread_cond_destroy(&pCond->m_Condition);
-        SAL_WARN_IF(
-            nRet != 0, "sal", "pthread_cond_destroy failed, errno %d, \"%s\"",
-            nRet, strerror(nRet));
-        nRet = pthread_mutex_destroy(&pCond->m_Lock);
-        SAL_WARN_IF(
-            nRet != 0, "sal", "pthread_mutex_destroy failed, errno %d, \"%s\"",
-            nRet, strerror(nRet));
-
-        free(Condition);
-    }
-
-    return;
-}
-
-/*****************************************************************************/
-/* osl_setCondition */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
-{
-   oslConditionImpl* pCond;
-   int nRet=0;
-
-   assert(Condition);
-   pCond = (oslConditionImpl*)Condition;
-
-   if ( pCond == 0 )
-   {
-       return sal_False;
-   }
-
-   nRet = pthread_mutex_lock(&pCond->m_Lock);
-   if ( nRet != 0 )
-   {
-       SAL_WARN(
-           "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
-           strerror(nRet));
-       return sal_False;
-   }
-
-   pCond->m_State = sal_True;
-   nRet = pthread_cond_broadcast(&pCond->m_Condition);
-   if ( nRet != 0 )
-   {
-       SAL_WARN(
-           "sal", "pthread_cond_broadcast failed, errno %d, \"%s\"", nRet,
-           strerror(nRet));
-       return sal_False;
-   }
-
-   nRet = pthread_mutex_unlock(&pCond->m_Lock);
-   if ( nRet != 0 )
-   {
-       SAL_WARN(
-           "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
-           strerror(nRet));
-       return sal_False;
-   }
-
-   return sal_True;
-
-}
-
-/*****************************************************************************/
-/* osl_resetCondition */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
-{
-    oslConditionImpl* pCond;
-    int nRet=0;
-
-    assert(Condition);
-
-    pCond = (oslConditionImpl*)Condition;
-
-    if ( pCond == 0 )
-    {
-        return sal_False;
-    }
-
-    nRet = pthread_mutex_lock(&pCond->m_Lock);
-    if ( nRet != 0 )
-    {
-        SAL_WARN(
-            "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
-            strerror(nRet));
-        return sal_False;
-    }
-
-    pCond->m_State = sal_False;
-
-    nRet = pthread_mutex_unlock(&pCond->m_Lock);
-    if ( nRet != 0 )
-    {
-       SAL_WARN(
-           "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
-           strerror(nRet));
-        return sal_False;
-    }
-
-    return sal_True;
-}
-
-/*****************************************************************************/
-/* osl_waitCondition */
-/*****************************************************************************/
-oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const TimeValue* pTimeout)
-{
-    oslConditionImpl* pCond;
-    int nRet=0;
-    oslConditionResult Result = osl_cond_result_ok;
-
-    assert(Condition);
-    pCond = (oslConditionImpl*)Condition;
-
-    if ( pCond == 0 )
-    {
-        return osl_cond_result_error;
-    }
-
-    nRet = pthread_mutex_lock(&pCond->m_Lock);
-    if ( nRet != 0 )
-    {
-        SAL_WARN(
-            "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
-            strerror(nRet));
-        return osl_cond_result_error;
-    }
-
-    if ( pTimeout )
-    {
-        if ( ! pCond->m_State )
-        {
-            int                 ret;
-            struct timeval      tp;
-            struct timespec     to;
-
-            gettimeofday(&tp, NULL);
-
-            SET_TIMESPEC( to, tp.tv_sec + pTimeout->Seconds,
-                              tp.tv_usec * 1000 + pTimeout->Nanosec );
-
-            /* spurious wake up prevention */
-            do
-            {
-                ret = pthread_cond_timedwait(&pCond->m_Condition, &pCond->m_Lock, &to);
-                if ( ret != 0 )
-                {
-                    if ( ret == ETIME || ret == ETIMEDOUT )
-                    {
-                        Result = osl_cond_result_timeout;
-                        nRet = pthread_mutex_unlock(&pCond->m_Lock);
-                        SAL_WARN_IF(
-                            nRet != 0, "sal",
-                            "pthread_mutex_unlock failed, errno %d, \"%s\"",
-                            nRet, strerror(nRet));
-
-                        return Result;
-                    }
-                    else if ( ret != EINTR )
-                    {
-                        Result = osl_cond_result_error;
-                        nRet = pthread_mutex_unlock(&pCond->m_Lock);
-                        SAL_WARN_IF(
-                            nRet != 0, "sal",
-                            "pthread_mutex_unlock failed, errno %d, \"%s\"",
-                            nRet, strerror(nRet));
-                        return Result;
-                    }
-                }
-            }
-            while ( !pCond->m_State );
-        }
-    }
-    else
-    {
-        while ( !pCond->m_State )
-        {
-            nRet = pthread_cond_wait(&pCond->m_Condition, &pCond->m_Lock);
-            if ( nRet != 0 )
-            {
-                SAL_WARN(
-                    "sal", "pthread_cond_wait failed, errno %d, \"%s\"", nRet,
-                    strerror(nRet));
-                Result = osl_cond_result_error;
-                nRet = pthread_mutex_unlock(&pCond->m_Lock);
-                SAL_WARN_IF(
-                    nRet != 0, "sal",
-                    "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
-                    strerror(nRet));
-
-                return Result;
-            }
-        }
-    }
-
-    nRet = pthread_mutex_unlock(&pCond->m_Lock);
-    SAL_WARN_IF(
-        nRet != 0, "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
-        strerror(nRet));
-
-    return Result;
-}
-
-/*****************************************************************************/
-/* osl_checkCondition */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition)
-{
-    sal_Bool State;
-    oslConditionImpl* pCond;
-    int nRet=0;
-
-    assert(Condition);
-    pCond = (oslConditionImpl*)Condition;
-
-    if ( pCond == 0 )
-    {
-        return sal_False;
-    }
-
-    nRet = pthread_mutex_lock(&pCond->m_Lock);
-    SAL_WARN_IF(
-        nRet != 0, "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
-        strerror(nRet));
-
-    State = pCond->m_State;
-
-    nRet = pthread_mutex_unlock(&pCond->m_Lock);
-    SAL_WARN_IF(
-        nRet != 0, "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
-        strerror(nRet));
-
-    return State;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/conditn.cxx b/sal/osl/unx/conditn.cxx
new file mode 100644
index 0000000..c6417bf
--- /dev/null
+++ b/sal/osl/unx/conditn.cxx
@@ -0,0 +1,360 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "sal/config.h"
+
+#include <assert.h>
+
+#include "system.h"
+#include <sal/log.hxx>
+#include <sal/types.h>
+
+#include <osl/conditn.h>
+#include <osl/time.h>
+
+
+typedef struct _oslConditionImpl
+{
+    pthread_cond_t  m_Condition;
+    pthread_mutex_t m_Lock;
+    sal_Bool            m_State;
+} oslConditionImpl;
+
+
+/*****************************************************************************/
+/* osl_createCondition */
+/*****************************************************************************/
+oslCondition SAL_CALL osl_createCondition()
+{
+      oslConditionImpl* pCond;
+    int nRet=0;
+
+    pCond = (oslConditionImpl*) malloc(sizeof(oslConditionImpl));
+
+    if ( pCond == 0 )
+    {
+        SAL_WARN("sal", "std::bad_alloc in C");
+        return 0;
+    }
+
+    pCond->m_State = sal_False;
+
+    /* init condition variable with default attr. (PTHREAD_PROCESS_PRIVAT) */
+    nRet =  pthread_cond_init(&pCond->m_Condition, PTHREAD_CONDATTR_DEFAULT);
+    if ( nRet != 0 )
+    {
+        SAL_WARN(
+            "sal",
+            "pthread_cond_init failed, errno " << nRet << ", \""
+                << strerror(nRet) << '"');
+
+        free(pCond);
+        return 0;
+    }
+
+    nRet = pthread_mutex_init(&pCond->m_Lock, PTHREAD_MUTEXATTR_DEFAULT);
+    if ( nRet != 0 )
+    {
+        SAL_WARN(
+            "sal",
+            "pthread_mutex_init failed, errno " << nRet << ", \""
+                << strerror(nRet) << '"');
+
+        nRet = pthread_cond_destroy(&pCond->m_Condition);
+        SAL_WARN_IF(
+            nRet != 0, "sal",
+            "pthread_cond_destroy failed, errno " << nRet << ", \""
+                << strerror(nRet) << '"');
+
+        free(pCond);
+        pCond = 0;
+    }
+
+    return (oslCondition)pCond;
+}
+
+/*****************************************************************************/
+/* osl_destroyCondition */
+/*****************************************************************************/
+void SAL_CALL osl_destroyCondition(oslCondition Condition)
+{
+    oslConditionImpl* pCond;
+    int nRet = 0;
+
+    if ( Condition )
+    {
+        pCond = (oslConditionImpl*)Condition;
+
+        nRet = pthread_cond_destroy(&pCond->m_Condition);
+        SAL_WARN_IF(
+            nRet != 0, "sal",
+            "pthread_cond_destroy failed, errno " << nRet << ", \""
+                << strerror(nRet) << '"');
+        nRet = pthread_mutex_destroy(&pCond->m_Lock);
+        SAL_WARN_IF(
+            nRet != 0, "sal",
+            "pthread_mutex_destroy failed, errno " << nRet << ", \""
+                << strerror(nRet) << '"');
+
+        free(Condition);
+    }
+
+    return;
+}
+
+/*****************************************************************************/
+/* osl_setCondition */
+/*****************************************************************************/
+sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
+{
+   oslConditionImpl* pCond;
+   int nRet=0;
+
+   assert(Condition);
+   pCond = (oslConditionImpl*)Condition;
+
+   if ( pCond == 0 )
+   {
+       return sal_False;
+   }
+
+   nRet = pthread_mutex_lock(&pCond->m_Lock);
+   if ( nRet != 0 )
+   {
+       SAL_WARN(
+           "sal",
+           "pthread_mutex_lock failed, errno " << nRet << ", \""
+               << strerror(nRet) << '"');
+       return sal_False;
+   }
+
+   pCond->m_State = sal_True;
+   nRet = pthread_cond_broadcast(&pCond->m_Condition);
+   if ( nRet != 0 )
+   {
+       SAL_WARN(
+           "sal",
+           "pthread_cond_broadcast failed, errno " << nRet << ", \""
+               << strerror(nRet) << '"');
+       return sal_False;
+   }
+
+   nRet = pthread_mutex_unlock(&pCond->m_Lock);
+   if ( nRet != 0 )
+   {
+       SAL_WARN(
+           "sal",
+           "pthread_mutex_unlock failed, errno " << nRet << ", \""
+               << strerror(nRet) << '"');
+       return sal_False;
+   }
+
+   return sal_True;
+
+}
+
+/*****************************************************************************/
+/* osl_resetCondition */
+/*****************************************************************************/
+sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
+{
+    oslConditionImpl* pCond;
+    int nRet=0;
+
+    assert(Condition);
+
+    pCond = (oslConditionImpl*)Condition;
+
+    if ( pCond == 0 )
+    {
+        return sal_False;
+    }
+
+    nRet = pthread_mutex_lock(&pCond->m_Lock);
+    if ( nRet != 0 )
+    {
+        SAL_WARN(
+            "sal",
+            "pthread_mutex_lock failed, errno " << nRet << ", \""
+                << strerror(nRet) << '"');
+        return sal_False;
+    }
+
+    pCond->m_State = sal_False;
+
+    nRet = pthread_mutex_unlock(&pCond->m_Lock);
+    if ( nRet != 0 )
+    {
+       SAL_WARN(
+           "sal", "pthread_mutex_unlock failed, errno " << nRet <<", \""
+               << strerror(nRet) << '"');
+        return sal_False;
+    }
+
+    return sal_True;
+}
+
+/*****************************************************************************/
+/* osl_waitCondition */
+/*****************************************************************************/
+oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const TimeValue* pTimeout)
+{
+    oslConditionImpl* pCond;
+    int nRet=0;
+    oslConditionResult Result = osl_cond_result_ok;
+
+    assert(Condition);
+    pCond = (oslConditionImpl*)Condition;
+
+    if ( pCond == 0 )
+    {
+        return osl_cond_result_error;
+    }
+
+    nRet = pthread_mutex_lock(&pCond->m_Lock);
+    if ( nRet != 0 )
+    {
+        SAL_WARN(
+            "sal", "pthread_mutex_lock failed, errno " << nRet <<", \""
+                << strerror(nRet) << '"');
+        return osl_cond_result_error;
+    }
+
+    if ( pTimeout )
+    {
+        if ( ! pCond->m_State )
+        {
+            int                 ret;
+            struct timeval      tp;
+            struct timespec     to;
+
+            gettimeofday(&tp, NULL);
+
+            SET_TIMESPEC( to, tp.tv_sec + pTimeout->Seconds,
+                              tp.tv_usec * 1000 + pTimeout->Nanosec );
+
+            /* spurious wake up prevention */
+            do
+            {
+                ret = pthread_cond_timedwait(&pCond->m_Condition, &pCond->m_Lock, &to);
+                if ( ret != 0 )
+                {
+                    if ( ret == ETIME || ret == ETIMEDOUT )
+                    {
+                        Result = osl_cond_result_timeout;
+                        nRet = pthread_mutex_unlock(&pCond->m_Lock);
+                        SAL_WARN_IF(
+                            nRet != 0, "sal",
+                            "pthread_mutex_unlock failed, errno " << nRet
+                                << ", \"" << strerror(nRet) << '"');
+
+                        return Result;
+                    }
+                    else if ( ret != EINTR )
+                    {
+                        Result = osl_cond_result_error;
+                        nRet = pthread_mutex_unlock(&pCond->m_Lock);
+                        SAL_WARN_IF(
+                            nRet != 0, "sal",
+                            "pthread_mutex_unlock failed, errno " << nRet
+                                << ", \"" << strerror(nRet) << '"');
+                        return Result;
+                    }
+                }
+            }
+            while ( !pCond->m_State );
+        }
+    }
+    else
+    {
+        while ( !pCond->m_State )
+        {
+            nRet = pthread_cond_wait(&pCond->m_Condition, &pCond->m_Lock);
+            if ( nRet != 0 )
+            {
+                SAL_WARN(
+                    "sal",
+                    "pthread_cond_wait failed, errno " << nRet << ", \""
+                        << strerror(nRet) << '"');
+                Result = osl_cond_result_error;
+                nRet = pthread_mutex_unlock(&pCond->m_Lock);
+                SAL_WARN_IF(
+                    nRet != 0, "sal",
+                    "pthread_mutex_unlock failed, errno " << nRet << ", \""
+                        << strerror(nRet) << '"');
+
+                return Result;
+            }
+        }
+    }
+
+    nRet = pthread_mutex_unlock(&pCond->m_Lock);
+    SAL_WARN_IF(
+        nRet != 0, "sal",
+        "pthread_mutex_unlock failed, errno " << nRet << ", \""
+            << strerror(nRet) << '"');
+
+    return Result;
+}
+
+/*****************************************************************************/
+/* osl_checkCondition */
+/*****************************************************************************/
+sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition)
+{
+    sal_Bool State;
+    oslConditionImpl* pCond;
+    int nRet=0;
+
+    assert(Condition);
+    pCond = (oslConditionImpl*)Condition;
+
+    if ( pCond == 0 )
+    {
+        return sal_False;
+    }
+
+    nRet = pthread_mutex_lock(&pCond->m_Lock);
+    SAL_WARN_IF(
+        nRet != 0, "sal",
+        "pthread_mutex_lock failed, errno " << nRet << ", \"" << strerror(nRet)
+            << '"');
+
+    State = pCond->m_State;
+
+    nRet = pthread_mutex_unlock(&pCond->m_Lock);
+    SAL_WARN_IF(
+        nRet != 0, "sal",
+        "pthread_mutex_unlock failed, errno " << nRet << ", \""
+            << strerror(nRet) << '"');
+
+    return State;
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/prj/d.lst b/sal/prj/d.lst
index 5023c57..c7f93ed 100644
--- a/sal/prj/d.lst
+++ b/sal/prj/d.lst
@@ -1,6 +1,7 @@
 mkdir: %_DEST%\bin\cppunit
 mkdir: %_DEST%\inc\cppunittester
 mkdir: %_DEST%\inc\sal
+mkdir: %_DEST%\inc\sal\detail
 mkdir: %_DEST%\inc\osl
 mkdir: %_DEST%\inc\rtl
 mkdir: %_DEST%\inc\systools
@@ -9,7 +10,9 @@ mkdir: %_DEST%\inc\systools\win32
 ..\inc\cppunittester\protectorfactory.hxx %_DEST%\inc\protectorfactory.hxx
 ..\%__SRC%\inc\rtlbootstrap.mk %_DEST%\inc\rtlbootstrap.mk
 ..\inc\sal\*.h %_DEST%\inc\sal\*.h
+..\inc\sal\log.hxx %_DEST%\inc\sal\log.hxx
 ..\inc\sal\precppunit.hxx %_DEST%\inc\sal\precppunit.hxx
+..\inc\sal\detail\log.h %_DEST%\inc\sal\detail\log.h
 ..\%__SRC%\inc\sal\typesizes.h %_DEST%\inc\sal\typesizes.h
 ..\inc\osl\*.h %_DEST%\inc\osl\*.h
 ..\inc\osl\*.hxx %_DEST%\inc\osl\*.hxx
diff --git a/sal/rtl/source/logfile.cxx b/sal/rtl/source/logfile.cxx
index c5858c1..a9bf40b 100644
--- a/sal/rtl/source/logfile.cxx
+++ b/sal/rtl/source/logfile.cxx
@@ -44,7 +44,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <rtl/alloc.h>
 #include <rtl/instance.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include "osl/thread.h"
 
 #include <algorithm>
@@ -109,7 +109,7 @@ OUString getFileUrl( const OUString &name )
     if ( osl_getFileURLFromSystemPath( name.pData, &aRet.pData )
          != osl_File_E_None )
     {
-        SAL_WARN_S(
+        SAL_WARN(
             "sal", "osl_getFileURLFromSystemPath failed for \"" << name << '"');
     }
 
@@ -185,7 +185,7 @@ void init() {
                 }
                 else
                 {
-                    SAL_WARN_S(
+                    SAL_WARN(
                         "sal",
                         "Couldn't open logfile " << o << '(' << e << ')');
                 }
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index a4fc06d..ad81dfc 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -50,7 +50,7 @@
 #include "sfx2/taskpane.hxx"
 #include <tools/diagnose_ex.h>
 #include <rtl/strbuf.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 
 #define SfxModule
 #include "sfxslots.hxx"
@@ -392,7 +392,7 @@ FieldUnit SfxModule::GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com
     SfxPoolItem const * pItem = pModule->GetItem( SID_ATTR_METRIC );
     if ( pItem == NULL )
     {
-        SAL_WARN_S(
+        SAL_WARN(
             "sfx2",
             "SfxModule::GetFieldUnit: no metric item in the module implemented"
                 " by '" << typeid(*pModule).name() << "'!");
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index ce1d604..9806290 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -33,7 +33,7 @@
 #include <iomanip>
 
 #include <boost/unordered_map.hpp>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <svl/itempool.hxx>
 #include <svl/itemiter.hxx>
 #include <svl/eitem.hxx>
@@ -1743,7 +1743,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer )
 sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine)
 {
     DBG_MEMTEST();
-    SAL_INFO_S(
+    SAL_INFO(
         "sfx2",
         std::setw(Min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this
             << " Level = " << nRegLevel << " SfxBindings::EnterRegistrations "
@@ -1844,7 +1844,7 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int
         }
     }
 
-    SAL_INFO_S(
+    SAL_INFO(
         "sfx2",
         std::setw(Min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this
             << " Level = " << nRegLevel << " SfxBindings::LeaveRegistrations "
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index c262291..ee7916d 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -476,7 +476,7 @@ void SfxDispatcher::Pop
 
     SfxApplication *pSfxApp = SFX_APP();
 
-    SAL_INFO_S(
+    SAL_INFO(
         "sfx2",
         "-SfxDispatcher(" << this << (bPush ? ")::Push(" : ")::Pop(")
             << (rShell.GetInterface()
@@ -1803,7 +1803,7 @@ void SfxDispatcher::FlushImpl()
     for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
         pImp->aFixedObjBars[n].nResId = 0;
 
-    SAL_INFO_S("sfx2", "SfxDispatcher(" << this << ")::Flush() done");
+    SAL_INFO("sfx2", "SfxDispatcher(" << this << ")::Flush() done");
 }
 
 //--------------------------------------------------------------------
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 33a6f47..22a23be 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -32,7 +32,7 @@
 #include <com/sun/star/embed/VerbAttributes.hpp>
 #include <basic/sbstar.hxx>
 #include <rtl/oustringostreaminserter.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <svl/itempool.hxx>
 #include <svl/undo.hxx>
 #include <svtools/itemdel.hxx>
@@ -625,7 +625,7 @@ void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI )
     if ( !p_IF )
         return;
 #endif
-    SAL_INFO_S(
+    SAL_INFO(
         "sfx2.vb",
         "SfxShell::DoActivate() " << this << "  " << GetInterface()->GetName()
             << " bMDI " << (bMDI ? "MDI" : ""));
@@ -661,7 +661,7 @@ void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI )
     if ( !p_IF )
         return;
 #endif
-    SAL_INFO_S(
+    SAL_INFO(
         "sfx2.vb",
         "SfxShell::DoDeactivate()" << this << "  " << GetInterface()->GetName()
             << " bMDI " << (bMDI ? "MDI" : ""));
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index ce5bb32..b9dac71 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -32,7 +32,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <tools/solar.h>
 #include <svl/itempool.hxx>
 #include "whassert.hxx"
@@ -956,11 +956,11 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
                                 delete rpNewItem;
                                 rpNewItem = pOldItem;
                                 bFound = true;
-                                SAL_INFO_S("svl", "reusing item" << pOldItem);
+                                SAL_INFO("svl", "reusing item" << pOldItem);
                                 break;
                             }
                         }
-                        SAL_INFO_IF_S(
+                        SAL_INFO_IF(
                             !bFound, "svl", "item not found: " << pOldItem);
                     }
                 }
diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx
index d994f0d..290b2f0 100644
--- a/svl/source/items/whassert.hxx
+++ b/svl/source/items/whassert.hxx
@@ -30,9 +30,9 @@
 
 #include "sal/config.h"
 
-#include "sal/log.h"
+#include "sal/log.hxx"
 
-#define SFX_ASSERT( bCondition, nId, sMessage ) SAL_WARN_IF_S( \
+#define SFX_ASSERT( bCondition, nId, sMessage ) SAL_WARN_IF( \
     !(bCondition), "svl", (sMessage) << ", with ID/pos " << (nId));
 
 #endif
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 04adab9..9b468a8 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -35,7 +35,7 @@
 
 #include <rtl/oustringostreaminserter.hxx>
 #include <rtl/ustring.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <svtools/textview.hxx>
 #include <svx/svxids.hrc>
 #include <vcl/scrbar.hxx>
@@ -163,7 +163,7 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
                     else
                     {
                         // what was that?
-                        SAL_WARN_S(
+                        SAL_WARN(
                             "sw.level2",
                             "Token " << rtl::OUString(sToken)
                                 << " not recognised!");
diff --git a/tools/inc/tools/debug.hxx b/tools/inc/tools/debug.hxx
index 95b3209..ecbfa3b 100644
--- a/tools/inc/tools/debug.hxx
+++ b/tools/inc/tools/debug.hxx
@@ -31,7 +31,7 @@
 
 #include "tools/toolsdllapi.h"
 
-#include <sal/log.h>
+#include <sal/detail/log.h>
 #include <sal/types.h>
 #include <tools/solar.h>
 
@@ -40,7 +40,7 @@
     if an assertion fails, and is controlled by the standard NDEBUG macro).
     Logging of warnings (e.g., about malformed input) and traces (e.g., about
     steps taken while executing some protocol) should use the facilities
-    provided by sal/log.h.
+    provided by sal/log.hxx.
 
     Because the assertion macros (DBG_ASSERTWARNING, DBG_ASSERT, DBG_BF_ASSERT)
     have been used for true assertions as well as for logged warnings, they map
@@ -467,33 +467,36 @@ public:
              (const void*)pObj, (DbgUsr)fTest )
 
 #define DBG_ASSERTWARNING( sCon, aWarning ) \
-    SAL_WARN_IF(!(sCon), "legacy.tools", aWarning)
+    SAL_DETAIL_WARN_IF_FORMAT(!(sCon), "legacy.tools", aWarning)
 
 #define DBG_ASSERT( sCon, aError ) \
-    SAL_WARN_IF(!(sCon), "legacy.tools", aError)
+    SAL_DETAIL_WARN_IF_FORMAT(!(sCon), "legacy.tools", aError)
 
 #ifdef DBG_BINFILTER
 #define DBG_BF_ASSERT( sCon, aError ) \
-    SAL_WARN_IF(!(sCon), "legacy.binfilter", aError)
+    SAL_DETAIL_WARN_IF_FORMAT(!(sCon), "legacy.binfilter", aError)
 #else
 #define DBG_BF_ASSERT( sCon, aError ) ((void)0)
 #endif
 
-#define DBG_WARNING( aWarning ) SAL_WARN("legacy.tools", aWarning)
-#define DBG_WARNING1( aWarning, x1 ) SAL_WARN("legacy.tools", aWarning, x1)
+#define DBG_WARNING( aWarning ) \
+    SAL_DETAIL_WARN_IF_FORMAT(true, "legacy.tools", aWarning)
+#define DBG_WARNING1( aWarning, x1 ) \
+    SAL_DETAIL_WARN_IF_FORMAT(true, "legacy.tools", aWarning, x1)
 #define DBG_WARNING2( aWarning, x1, x2 ) \
-    SAL_WARN("legacy.tools", aWarning, x1, x2)
+    SAL_DETAIL_WARN_IF_FORMAT(true, "legacy.tools", aWarning, x1, x2)
 #define DBG_WARNING3( aWarning, x1, x2, x3 ) \
-    SAL_WARN("legacy.tools", aWarning, x1, x2, x3)
+    SAL_DETAIL_WARN_IF_FORMAT(true, "legacy.tools", aWarning, x1, x2, x3)
 #define DBG_WARNING4( aWarning, x1, x2, x3, x4 ) \
-    SAL_WARN("legacy.tools", aWarning, x1, x2, x3, x4)
+    SAL_DETAIL_WARN_IF_FORMAT(true, "legacy.tools", aWarning, x1, x2, x3, x4)
 #define DBG_WARNING5( aWarning, x1, x2, x3, x4, x5 ) \
-    SAL_WARN("legacy.tools", aWarning, x1, x2, x3, x4, x5)
-#define DBG_WARNINGFILE( aWarning ) \
-    SAL_WARN("legacy.tools", aWarning, __FILE__, __LINE__)
+    SAL_DETAIL_WARN_IF_FORMAT( \
+        true, "legacy.tools", aWarning, x1, x2, x3, x4, x5)
+#define DBG_WARNINGFILE( aWarning ) SAL_DETAIL_WARN_IF_FORMAT( \
+    true, "legacy.tools", aWarning, __FILE__, __LINE__)
 
 #define DBG_ERRORFILE( aError ) \
-    SAL_WARN("legacy.tools", aError, __FILE__, __LINE__)
+    SAL_DETAIL_WARN_IF_FORMAT(true, "legacy.tools", aError, __FILE__, __LINE__)
 
 #define DBG_TESTSOLARMUTEX()                \
 do                                          \
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index d3f2c08..091f459 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -50,7 +50,7 @@
 
 #include <tools/debug.hxx>
 #include <rtl/string.h>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <sal/macros.h>
 
 #include <vector>
@@ -1334,7 +1334,7 @@ void DbgProf( sal_uInt16 nAction, DbgDataType* pDbgData )
     sal_uIntPtr       nTime;
     if ( (nAction != DBG_PROF_START) && !pProfData )
     {
-        SAL_WARN_S(
+        SAL_WARN(
             "tools.debug",
             "DBG_PROF...() without DBG_PROFSTART(): " << pDbgData->pName);
         return;
@@ -1454,7 +1454,7 @@ void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis,
 
     sal_uInt16      nAct = nAction & ~DBG_XTOR_DTOROBJ;
 
-    SAL_INFO_IF_S(
+    SAL_INFO_IF(
         ((pData->aDbgData.nTestFlags & DBG_TEST_XTOR_TRACE)
          && !(nAction & DBG_XTOR_DTOROBJ) && nAct != DBG_XTOR_CHKOBJ),
         "tools.debug",
@@ -1468,7 +1468,7 @@ void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis,
         // DBG_CTOR-Aufruf vor allen anderen DBG_XTOR-Aufrufen
         if ( ((nAction & ~DBG_XTOR_DTOROBJ) != DBG_XTOR_CTOR) && !pDbgData->pData )
         {
-            SAL_WARN_S(
+            SAL_WARN(
                 "tools.debug",
                 "DBG_DTOR() or DBG_CHKTHIS() without DBG_CTOR(): "
                     << pDbgData->pName);
@@ -1484,7 +1484,7 @@ void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis,
                 // This-Pointer == NULL
                 if ( !pThis )
                 {
-                    SAL_WARN_S(
+                    SAL_WARN(
                         "tools.debug",
                         "this == NULL in class " << pDbgData->pName);
                     return;
@@ -1492,7 +1492,7 @@ void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis,
 
                 if ( (nAction & ~DBG_XTOR_DTOROBJ) != DBG_XTOR_CTOR )
                 {
-                    SAL_WARN_IF_S(
+                    SAL_WARN_IF(
                         !pXtorData->aThisList.IsIn(pThis), "tools.debug",
                         "invalid this-Pointer %p in class " << pDbgData->pName);
                 }
@@ -1558,13 +1558,13 @@ void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis,
         }
 
         // Gegebenenfalls Fehlermeldung ausgeben
-        SAL_WARN_IF_S(
+        SAL_WARN_IF(
             pMsg, "tools.debug",
             "Error-Msg from Object " << pThis << " in class "
                 << pDbgData->pName << ": " << pMsg);
     }
 
-    SAL_INFO_IF_S(
+    SAL_INFO_IF(
         ((pData->aDbgData.nTestFlags & DBG_TEST_XTOR_TRACE)
          && (nAction & DBG_XTOR_DTOROBJ) && nAct != DBG_XTOR_CHKOBJ),
         "tools.debug",
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 2ea66b2..93b8ea1 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -46,7 +46,7 @@
 #include <rtl/oustringostreaminserter.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/strbuf.hxx>
-#include <sal/log.h>
+#include <sal/log.hxx>
 #include <tools/urlobj.hxx>
 #include <rtl/instance.hxx>
 #include <rtl/bootstrap.hxx>
@@ -949,7 +949,7 @@ void ResMgr::Init( const OUString& rFileName )
             InternalResMgr::FreeGlobalRes( aResHandle, pVoid );
         else
         {
-            SAL_WARN_S("tools", "Wrong version: " << pImpRes->aFileName);
+            SAL_WARN("tools", "Wrong version: " << pImpRes->aFileName);
         }
     }
 #endif
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 126c56c..cb6aa53 100755
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -39,7 +39,7 @@
 #include <limits.h>
 
 #include "tools/debug.hxx"
-#include "sal/log.h"
+#include "sal/log.hxx"
 
 #include "vcl/svapp.hxx"
 #include "vcl/event.hxx"


More information about the Libreoffice-commits mailing list