Improved support for assertions and logging in C and C++
