DEPRECATED: improved version available here
C/C++ logging library.
The library is divided in these 2 parts:
Lightweight cross-platform logging library.
Pretty much the same as CTrace but adds the following features:
- Console ouput uses colors.
- Can retrieve windows error messages.
- TCHAR support.
void important_function(void)
{
/* these are not necessary but often useful */
CTRACE_ENTER_FN();
/* ... does stuff ... */
if (/* condition */) {
/* An error has occured. Log it and return. */
CTRACEE("oops! %d - %s", some_number, some_string);
CTRACE_EXIT_FN();
return;
}
/* ... more stuff ... */
/* these are not necessary but often useful */
CTRACE_EXIT_FN();
}
void important_function(void)
{
/* these are not necessary but often useful */
CWTRACE_ENTER_FN();
/* ... does stuff ... */
if (/* condition */) {
/* An error has occured. Log it and return. */
CWTRACEE(TEXT("oops! %d - %s"), some_number, some_wide_string);
CWTRACE_EXIT_FN();
return;
}
/* ... more stuff ... */
/* these are not necessary but often useful */
CWTRACE_EXIT_FN();
}
See the examples folder