Overview ~~~~~~~~ libdiagnose is a simple debugging, logging and error-reporting library for C/C++ with support for regular expressions and a callback functionality. This library aims to provide a flexible, easy to use and filter program status reporting solution for C/C++ developers. It was originally written for fast diagnostics of program errors. It developed over time into a complete program status reporting library with a callback functionality and support for regular expressions. The library supports 4 types of messages: log, debug, warning and error messages. Every message can have several formats based on a user's choice (bare, normal, time, hexadump, ...). The filtering functionality of the library supports several levels of verbosity reporting and regular expressions using the PCRE library for each type of the messages or all messages in general. The filtering can be masked by a program using this library directly, or from the environment in which the program runs. The intended use of this library is to make programs call the library API macros rather than external functions. It is then possible to generate a replacement header file with empty macros by a script provided and make programs compile without the library. It is also possible to selectively disable/enable parts of the library functionality. For instance, this might be desirable when compiling programs without debugging information for performance reasons. User manual ~~~~~~~~~~~ For the time being, please refer to the source, in particular dg_test.c and env.sh script. When using the library, make sure you don't call dg directly, but use them through DM_. There are two reasons for this: 1) dg names are NOT guaranteed to remain unchanged during the development of the library. 2) A program that uses this library can be built without it just by importing a header file with empty macros. Please see the dg.h file for the available macros. The diagnose library environment variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Verbosity level masks: DG_(DIAGNOSE|LOG|DBG|WARN|ERR) Regular expression filters: DG_(DIAGNOSE|LOG|DBG|WARN|ERR)_(FILE|FUNC)v? DIAGNOSE affects all the other types of messages: LOG, DBG, WARN and ERR.