summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-15 12:42:15 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-05-27 17:18:52 +0200
commit9c36f071b10b591240dae4c36c27dc032e80688b (patch)
tree91e48a3058503c1e2f5de53411eb45c4298bbfc9 /include
parent54b8a23f96944df17c6a05341b25b315c62ad2da (diff)
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@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/diagnose_ex.h21
1 files changed, 21 insertions, 0 deletions
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