Move more log related things to log.c