added the log.c file for logging, similar to printf