add the log function for the program