Simple colorful C / C++ Logger
- log.h: Logger header file without program's execute time
- logwt.h: Logger header file with program's execute time
- Copy
log.h
,logwt.h
andtime_printf.o
to your source code folder - Include
log.h
orlogwt.h
to your C source code - Link
time_printf.o
when compile
debug(Message, [arguments])
: Show debug messagelog_err(Message, [arguments])
: Show error messagelog_warn(Message, [arguments])
: Show warning messagelog_info(Message, [arguments])
: Show info messagecheck(Conditional, Message, [arguments])
: Check ifConditional
is false, returnError Message
and gotoerror
labelcheck_mem(Object / Variable)
: CheckObject
orVariable
created into memorycheck_debug(Conditional, Message, [arguments])
: Check ifConditional
is false, returnDebug Message
and gotoerror
labelsentinel(Message, [arguments])
: Same aslog_err()
and gotoerror
label
- Time: Magenta
- Debug Log: Cyan
- Error Log: Red
- Info Log: Default Terminal Text Color
- This tool is based on debug tool on the book Learn C The Hard Way by Zed A. Shaw