|
This API allows you to combine traditional assert()-based programming with diagnostic logging, using the PANTHEIOS_ASSERT() macro.
int main() { PANTHEIOS_ASSERT(false); // Will assert, and will log
return 0; }
Defines | |
#define | PANTHEIOS_ASSERT_SEVERITY_LEVEL PANTHEIOS_SEV_EMERGENCY |
The level at which log statements will be submitted by PANTHEIOS_ASSERT and PANTHEIOS_MESSAGE_ASSERT . | |
#define | PANTHEIOS_ASSERT(expr) |
Defines an assertion construct for runtime verification. | |
#define | PANTHEIOS_MESSAGE_ASSERT(expr, msg) |
Defines an assertion construct for runtime verification. |
#define PANTHEIOS_ASSERT | ( | expr | ) |
Value:
\ do \ { \ if(!(expr)) \ { \ PANTHEIOS_NS_QUAL(pantheios_logassertfail)(PANTHEIOS_ASSERT_SEVERITY_LEVEL, PANTHEIOS_FILELINE_A, "assertion failed: " #expr); \ } \ \ STLSOFT_ASSERT(expr); \ } while(0)
expr | Must be non-zero, or an assertion will be fired |
STLSOFT_ASSERT()
#define PANTHEIOS_ASSERT_SEVERITY_LEVEL PANTHEIOS_SEV_EMERGENCY |
The level at which log statements will be submitted by PANTHEIOS_ASSERT
and PANTHEIOS_MESSAGE_ASSERT
.
Defaults to PANTHEIOS_SEV_EMERGENCY
#define PANTHEIOS_MESSAGE_ASSERT | ( | expr, | |||
msg | ) |
Value:
\ do \ { \ if(!(expr)) \ { \ PANTHEIOS_NS_QUAL(pantheios_logassertfail)(PANTHEIOS_ASSERT_SEVERITY_LEVEL, PANTHEIOS_FILELINE_A, "assertion failed: " #expr "; message: " msg); \ } \ \ STLSOFT_MESSAGE_ASSERT(msg, expr); \ } while(0)
expr | Must be non-zero, or an assertion will be fired | |
msg | The message that will be associated with the output if the assertion fires |
STLSOFT_MESSAGE_ASSERT()
|
|
pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 |