Add toggle function to logfile.