LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
|
Provides simple diagnostic support. More...
Go to the source code of this file.
Macros | |
#define | OSL_DEBUG_LEVEL 0 |
#define | OSL_LOG_PREFIX SAL_DETAIL_WHERE |
#define | OSL_TRACE(...) SAL_DETAIL_INFO_IF_FORMAT(OSL_DEBUG_LEVEL > 0, "legacy.osl", __VA_ARGS__) |
Prints trace message. More... | |
#define | OSL_ASSERT(c) SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "OSL_ASSERT: %s", #c) |
If cond is false, reports an error. More... | |
#define | OSL_ENSURE(c, m) SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "%s", m) |
If cond is false, reports an error with message msg. More... | |
#define | OSL_FAIL(m) SAL_DETAIL_WARN_IF_FORMAT(sal_True, "legacy.osl", "%s", m) |
Reports an error with message msg unconditionally. More... | |
#define | OSL_VERIFY(c) do { if (!(c)) OSL_ASSERT(0); } while (0) |
Evaluates the expression and if it is false, reports an error. More... | |
#define | OSL_PRECOND(c, m) OSL_ENSURE(c, m) |
Check the precondition of functions. More... | |
#define | OSL_POSTCOND(c, m) OSL_ENSURE(c, m) |
Check the postcondition of functions. More... | |
Provides simple diagnostic support.
Because the assertion macros (OSL_ASSERT, OSL_ENSURE, OSL_FAIL, OSL_PRECOND, and OSL_POSTCOND) have been used for true assertions as well as for logged warnings, they map to SAL_WARN instead of standard assert. OSL_TRACE maps to SAL_INFO.
The functions defined in this header are not intended to be used directly, but through defined macros. The macros can be divided into three categories: assertions, traces and other stuff .-) Their usability depends on the value of OSL_DEBUG_LEVEL macro: assertions are only active if OSL_DEBUG_LEVEL is 1 or greater, traces if OSL_DEBUG_LEVEL is 2 or greater.
Traces: OSL_TRACE(fmt, args...) Prints trace message. The arguments have the same meaning as the arguments of printf.
#define OSL_DEBUG_LEVEL 0 |
#define OSL_LOG_PREFIX SAL_DETAIL_WHERE |
#define OSL_TRACE | ( | ... | ) | SAL_DETAIL_INFO_IF_FORMAT(OSL_DEBUG_LEVEL > 0, "legacy.osl", __VA_ARGS__) |
Prints trace message.
The arguments have the same meaning as the arguments of printf.