diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-10-31 02:33:46 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-11-01 12:23:38 +0100 |
commit | c8c11b55456df5b418848ac3159b9f370215bc09 (patch) | |
tree | ab2377c21e8fb17bdc2bf9a01f235078079ef094 /include/sal | |
parent | fa9b28c781d4d3e97f7dcf150a0e22e70289c228 (diff) |
Add SAL_DEBUG_IF
Change-Id: If2452cd4bad7266e7e07baaea26c58ef26ead5f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124509
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'include/sal')
-rw-r--r-- | include/sal/log.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sal/log.hxx b/include/sal/log.hxx index c64ea5079c81..5faeec3113dc 100644 --- a/include/sal/log.hxx +++ b/include/sal/log.hxx @@ -386,6 +386,17 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) { SAL_LOG_TRUE, ::SAL_DETAIL_LOG_LEVEL_DEBUG, NULL, NULL, stream) /** + Produce temporary debugging output from stream, if condition is true. 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_IF(condition, stream) \ + SAL_DETAIL_LOG_STREAM( \ + (condition), ::SAL_DETAIL_LOG_LEVEL_DEBUG, NULL, NULL, stream) + +/** Produce temporary debugging output from stream along with a backtrace of the calling location. |