[Libreoffice-commits] core.git: config_host/config_options.h.in configure.ac sal/osl

Thorsten Behrens Thorsten.Behrens at CIB.de
Tue May 8 21:55:56 UTC 2018


 config_host/config_options.h.in |    6 ++++++
 configure.ac                    |    4 +++-
 sal/osl/all/log.cxx             |    8 ++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 4c5b4752786ae2c174cd8fa8aa42b27a0994f34a
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Mon Jan 16 05:04:20 2017 +0100

    sal: log windows trace output to debugger console
    
    Change-Id: Ic8fea70fd3b0b2d4881cd30e3616f5bbf7c0c533
    Reviewed-on: https://gerrit.libreoffice.org/53776
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/config_host/config_options.h.in b/config_host/config_options.h.in
index 0223f089ce2b..e6c0f8d4c7b0 100644
--- a/config_host/config_options.h.in
+++ b/config_host/config_options.h.in
@@ -13,4 +13,10 @@
 
 #define ENABLE_RUNTIME_OPTIMIZATIONS 0
 
+/*
+ * If this is a production build (where we might want to cut down on
+ * debugging options)
+ */
+#define ENABLE_RELEASE_BUILD 0
+
 #endif
diff --git a/configure.ac b/configure.ac
index c5f0edc9eb7f..fca2d4d9044b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2243,11 +2243,13 @@ dnl ===================================================================
 dnl Test whether build target is Release Build
 dnl ===================================================================
 AC_MSG_CHECKING([whether build target is Release Build])
+ENABLE_RELEASE_BUILD=
+
 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
     AC_MSG_RESULT([no])
-    ENABLE_RELEASE_BUILD=
 else
     AC_MSG_RESULT([yes])
+    AC_DEFINE(ENABLE_RELEASE_BUILD)
     ENABLE_RELEASE_BUILD=TRUE
 fi
 AC_SUBST(ENABLE_RELEASE_BUILD)
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index bebc8e5647ca..25662507ce18 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -22,6 +22,7 @@
 #include <fstream>
 
 #include <config_global.h>
+#include <config_options.h>
 #include <osl/thread.hxx>
 #include <rtl/string.h>
 #include <sal/detail/log.h>
@@ -326,9 +327,16 @@ void sal_detail_log(
             *logFile << s.str() << std::endl;
         }
         else {
+#ifdef WNT
+            // write to Windows debugger console, too
+            OutputDebugStringA(s.str().c_str());
+#endif
+#if ! (defined(WNT) && ENABLE_RELEASE_BUILD)
+            // on Windows deployments, no one reads console output
             s << '\n';
             std::fputs(s.str().c_str(), stderr);
             std::fflush(stderr);
+#endif
         }
     }
 #endif


More information about the Libreoffice-commits mailing list