Add logging and datestamps in C