Add print to file function.