logging.c: simple logging implementation