From 01ae64a38f4ec381ec293b724c8be55c2c38d72e Mon Sep 17 00:00:00 2001 From: postables Date: Mon, 10 Aug 2020 16:59:34 -0700 Subject: [PATCH] update readme with compilation instructions --- README.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 352c6a1..3ed1ea2 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,43 @@ I wanted a simple logging library that didnt leak memory, was well tested, and c # installation -To install you can simply copy and paste the `logger.h`, `colors.h`, `logger.c`, and `colors.c` files into whatever project you are working on. +To install you can simply copy and paste the `logger.h`, `colors.h`, `logger.c`, and `colors.c` files into whatever project you are working on. You will need to make sure that you have pthreads available to link with as the logger library has a pthreads dependency. + +# testing + +Before testing you'll need to compile the code, for which you have two options + +Release mode + +```shell +$> make +``` + +Debug mode + +```shell +$> make build-debug +``` + +Running either of the following two commands will build a test executable `logger-test` within the `build` folder. You can either invoke this manually or use `ctest`. + +Regular unit testing: + +```shell +$> ctest +``` + +Valgrind dynamic analysis and unit testing: + +```shell +$> ctest -T memcheck +``` # usage The following code samples produce the output shown in the screenshot at the start of the readme. -## No File Logging +## no file logging ```C #include @@ -44,7 +74,7 @@ LOGF_DEBUG(thl, 0, "this is a %s style debug log", "printf"); clear_thread_logger(thl); ``` -## File Logging +## file logging ```C #include