The foci of this repository are the logger.c
and logger.h
files. They define the printError
function which allows you to print detailed
and descriptive error messages to aid in development and debugging.
Add logger.c
and logger.h
to your project, update your build script, and
compile as you normally would.
See the provided Makefile as a reference.
See C_Mutex and C_PThread as references.
Parameters:
- If you know that an error has occured and that errno has been set, then set the first parameter to
errno
. Else set it to0
. - This should be set to
__FILE__
, but it also acceptsNULL
. - This should be set to
__PRETTY_FUNCTION__
, but it also acceptsNULL
. - This should contain a descriptive error message, specific to your program, and should contain information helpful in debugging the related error. This also accepts
NULL
.
Example:
printError(errno, __FILE__, __PRETTY_FUNCTION__, "Some error message.");