Replaces prints with logging and removes a log file.