If you move the computation of the file-name into logInit(), you can avoid heap traffic (and checking) by using an auto array entirely local to logInit().

char log_name[] = "cf-upgrade-YYYYMMDD-HHMMSS.log";
strftime(log_name, sizeof(log_name), ...); /* over-writes the YYYYMMDD-HHMMSS */