You can link this code snippet just to your project or create a shared libary and link your code against this
with the following command you can create a shared libary out of the code snippets
bash$> gcc -c -fPIC logger.c -o logger.obash$> gcc -shared logger.o -o libClogger.so
bash$> rm logger.o
now copy logger.so into the directory where your linux distro stores the shared libaries
when you want to link the shared libary now you just have to type ..