Kaydet (Commit) 4c5b4752 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

sal: log windows trace output to debugger console

Change-Id: Ic8fea70fd3b0b2d4881cd30e3616f5bbf7c0c533
Reviewed-on: https://gerrit.libreoffice.org/53776Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 59c1fa3f
...@@ -13,4 +13,10 @@ ...@@ -13,4 +13,10 @@
#define ENABLE_RUNTIME_OPTIMIZATIONS 0 #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 #endif
...@@ -2243,11 +2243,13 @@ dnl =================================================================== ...@@ -2243,11 +2243,13 @@ dnl ===================================================================
dnl Test whether build target is Release Build dnl Test whether build target is Release Build
dnl =================================================================== dnl ===================================================================
AC_MSG_CHECKING([whether build target is Release Build]) AC_MSG_CHECKING([whether build target is Release Build])
ENABLE_RELEASE_BUILD=
if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
ENABLE_RELEASE_BUILD=
else else
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
AC_DEFINE(ENABLE_RELEASE_BUILD)
ENABLE_RELEASE_BUILD=TRUE ENABLE_RELEASE_BUILD=TRUE
fi fi
AC_SUBST(ENABLE_RELEASE_BUILD) AC_SUBST(ENABLE_RELEASE_BUILD)
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <fstream> #include <fstream>
#include <config_global.h> #include <config_global.h>
#include <config_options.h>
#include <osl/thread.hxx> #include <osl/thread.hxx>
#include <rtl/string.h> #include <rtl/string.h>
#include <sal/detail/log.h> #include <sal/detail/log.h>
...@@ -326,9 +327,16 @@ void sal_detail_log( ...@@ -326,9 +327,16 @@ void sal_detail_log(
*logFile << s.str() << std::endl; *logFile << s.str() << std::endl;
} }
else { 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'; s << '\n';
std::fputs(s.str().c_str(), stderr); std::fputs(s.str().c_str(), stderr);
std::fflush(stderr); std::fflush(stderr);
#endif
} }
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment