[Libreoffice-commits] core.git: include/tools
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed May 27 15:19:31 UTC 2020
include/tools/diagnose_ex.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
New commits:
commit 9c36f071b10b591240dae4c36c27dc032e80688b
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 15 12:42:15 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed May 27 17:18:52 2020 +0200
ofz#22222 avoid calling DbgGetCaughtException if unnecessary
Change-Id: Ia48240d2c0218ac3b790c78f458896a90c586869
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94304
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h
index 558420e5417f..7d266464b1db 100644
--- a/include/tools/diagnose_ex.h
+++ b/include/tools/diagnose_ex.h
@@ -138,31 +138,52 @@ TOOLS_DLLPUBLIC OString exceptionToString(css::uno::Any const & caughtEx);
Logs an message along with a nicely formatted version of the current exception.
This must be called as the FIRST thing in a catch block.
*/
+#if defined SAL_LOG_WARN
#define TOOLS_WARN_EXCEPTION(area, stream) \
do { \
css::uno::Any tools_warn_exception( DbgGetCaughtException() ); \
SAL_WARN(area, stream << " " << exceptionToString(tools_warn_exception)); \
} while (false)
+#else
+#define TOOLS_WARN_EXCEPTION(area, stream) \
+ do { \
+ SAL_WARN(area, stream); \
+ } while (false)
+#endif
/**
Logs an message along with a nicely formatted version of the current exception.
This must be called as the FIRST thing in a catch block.
*/
+#if defined SAL_LOG_WARN
#define TOOLS_WARN_EXCEPTION_IF(cond, area, stream) \
do { \
css::uno::Any tools_warn_exception( DbgGetCaughtException() ); \
SAL_WARN_IF(cond, area, stream << " " << exceptionToString(tools_warn_exception)); \
} while (false)
+#else
+#define TOOLS_WARN_EXCEPTION_IF(cond, area, stream) \
+ do { \
+ SAL_WARN_IF(cond, area, stream); \
+ } while (false)
+#endif
/**
Logs an message along with a nicely formatted version of the current exception.
This must be called as the FIRST thing in a catch block.
*/
+#if defined SAL_LOG_INFO
#define TOOLS_INFO_EXCEPTION(area, stream) \
do { \
css::uno::Any tools_warn_exception( DbgGetCaughtException() ); \
SAL_INFO(area, stream << " " << exceptionToString(tools_warn_exception)); \
} while (false)
+#else
+#define TOOLS_INFO_EXCEPTION(area, stream) \
+ do { \
+ SAL_INFO(area, stream); \
+ } while (false)
+#endif
#endif
More information about the Libreoffice-commits
mailing list