fn write_error_log(
    volta_version: &str,
    message: String,
    details: String,
) -> Result<PathBuf, Error> {
    let file_name = Local::now()
        .format("volta-error-%Y-%m-%d_%H_%M_%S%.3f.log")
        .to_string();
    let log_file_path = volta_home()?.log_dir().join(&file_name);

    ensure_containing_dir_exists(&log_file_path)?;
    let mut log_file = File::create(&log_file_path)?;

    writeln!(log_file, "{}", collect_arguments())?;
    writeln!(log_file, "Volta v{}", volta_version)?;
    writeln!(log_file)?;
    writeln!(log_file, "{}", message)?;
    writeln!(log_file)?;
    writeln!(log_file, "{}", details)?;

    Ok(log_file_path)
}
/// Write an error log with all details about the error
Write an error log with all details about the error
Write an error log with all details about the error
fn write_error_log(
    volta_version: &str,
    message: String,
    details: String,
) -> Result<PathBuf, Error> {
    let file_name = Local::now()
        .format("volta-error-%Y-%m-%d_%H_%M_%S%.3f.log")
        .to_string();
    let log_file_path = volta_home()?.log_dir().join(&file_name);
    ensure_containing_dir_exists(&log_file_path)?;
    let mut log_file = File::create(&log_file_path)?;
    writeln!(log_file, "{}", collect_arguments())?;
    writeln!(log_file, "Volta v{}", volta_version)?;
    writeln!(log_file)?;
    writeln!(log_file, "{}", message)?;
    writeln!(log_file)?;
    writeln!(log_file, "{}", details)?;
    Ok(log_file_path)
}
fn write_error_log ( volta_version : & str , message : String , details : String , ) -> Result < PathBuf , Error > { let file_name = Local :: now ( ) . format ( " " ) . to_string ( ) ; let log_file_path = volta_home ( ) ? . log_dir ( ) . join ( & file_name ) ; ensure_containing_dir_exists ( & log_file_path ) ? ; let mut log_file = File :: create ( & log_file_path ) ? ; writeln ! ( log_file " " collect_arguments ( ) ) ? ; writeln ! ( log_file " " volta_version ) ? ; writeln ! ( log_file ) ? ; writeln ! ( log_file " " message ) ? ; writeln ! ( log_file ) ? ; writeln ! ( log_file " " details ) ? ; Ok ( log_file_path ) }
Write an error log with all details about the error
Write an error log with all details about the error
volta_version
&str
message
String
details
String
volta_version
&str
message
String
details
String