pub fn set_file(path: impl AsRef<Path>) -> Result<()>
Sets the output target to a file.
This function will return an error if the file cannot be opened for writing.