This implements a very rudimentary C logger library for educational purposes.
lclog
stands for (l)ightweight (C) (log)ger.
On your C program include the library header file:
#include <lclog.h>
int main() {
// create a logger with your desired prefix
lclog *logger = lclog_new("[INFO]");
// ... do more stuff
// use the logger
lclog_log(logger, "application startup complete");
// ... do more stuff
// free the memory
lclog_free(logger);
}
Install the library and headers to standard linux locations:
$ make && make install
To run tests:
$ make test
No output means all good!