Some functions to manipulate the logfile