From 94427a1b000344b24948374953a099571901a2ed Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 26 Oct 2015 14:13:10 +0000 Subject: sal: add SAL_DEBUG_TRACE debugging API for Windows, with UNX stub. Change-Id: I2fdbc2ac10f483eee154bdf69479ba217a91ef7f Reviewed-on: https://gerrit.libreoffice.org/19605 Tested-by: Jenkins Reviewed-by: Michael Meeks Tested-by: Michael Meeks --- include/sal/detail/log.h | 1 + include/sal/log.hxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'include/sal') diff --git a/include/sal/detail/log.h b/include/sal/detail/log.h index 11ece36c3279..ab9718518646 100644 --- a/include/sal/detail/log.h +++ b/include/sal/detail/log.h @@ -52,6 +52,7 @@ extern "C" { enum sal_detail_LogLevel { SAL_DETAIL_LOG_LEVEL_INFO, SAL_DETAIL_LOG_LEVEL_WARN, + SAL_DETAIL_LOG_LEVEL_DEBUG_TRACE = SAL_MAX_ENUM - 1, SAL_DETAIL_LOG_LEVEL_DEBUG = SAL_MAX_ENUM }; diff --git a/include/sal/log.hxx b/include/sal/log.hxx index aefcdd1f7f5f..e01d70870042 100644 --- a/include/sal/log.hxx +++ b/include/sal/log.hxx @@ -316,6 +316,18 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) { SAL_DETAIL_LOG_STREAM( \ SAL_LOG_TRUE, ::SAL_DETAIL_LOG_LEVEL_DEBUG, NULL, NULL, stream) +/** + Produce temporary debugging output from stream along with a + stack trace of the calling location. This macro is meant to + be used only while working on code and should never exist + in production code. + + See @ref sal_log "basic logging functionality" for details. +*/ +#define SAL_DEBUG_TRACE(stream) \ + SAL_DETAIL_LOG_STREAM( \ + SAL_LOG_TRUE, ::SAL_DETAIL_LOG_LEVEL_DEBUG_TRACE, NULL, NULL, stream) + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit