Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Fri, Nov 18, 2011 at 03:25:16PM +0100, Stephan Bergmann <sbergman@redhat.com> wrote:
 #define OSL_DEBUG_ONLY(s)   _OSL_DEBUG_ONLY(s)
-#define OSL_TRACE           _OSL_TRACE
-#define OSL_ASSERT(c)       _OSL_ENSURE(c, OSL_THIS_FILE, __LINE__, 0)
-#define OSL_ENSURE(c, m)   _OSL_ENSURE(c, OSL_THIS_FILE, __LINE__, m)
-#define OSL_FAIL(m)        _OSL_ENSURE(0, OSL_THIS_FILE, __LINE__, m)
+#define OSL_TRACE(...) SAL_INFO("legacy.osl", __VA_ARGS__)
+#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)

Hi Stephan,

These changes cause that without an

export SAL_LOG="+INFO"

former OSL_TRACE() messages do not show up on the console, even with
dbglevel=2.

I like that SAL_LOG can now filter SAL_INFO messages, but are you sure
it's a good idea to disable them all by default with dbglevel=2, instead
of enabling them by default (when SAL_LOG is not set), like it was
before?

IOW, is the attached patch OK?

Thanks.
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index be45cf6..9493715 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -84,7 +84,11 @@ bool report(sal_detail_LogLevel level, char const * area) {
     assert(area != 0);
     char const * env = std::getenv("SAL_LOG");
     if (env == 0) {
+#if OSL_DEBUG_LEVEL > 1
+        env = "+INFO+WARN";
+#else
         env = "+WARN";
+#endif
     }
     std::size_t areaLen = std::strlen(area);
     enum Sense { POSITIVE = 0, NEGATIVE = 1 };

Attachment: pgp5_Xyx2J8RO.pgp
Description: PGP signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.