Skip to main content

log_arguments

Function log_arguments 

Source
pub fn log_arguments(log_file: &mut File, date: &str) -> Result<()>
Expand description

Logs processed command-line arguments for debugging and auditing.

Records all provided command-line arguments and their values in the log file, providing a traceable record of site generation parameters.

§Arguments

  • log_file - Active file handle for writing log entries
  • date - Current date and time for log timestamps

§Returns

  • Ok(()) - If arguments are logged successfully
  • Err - If writing fails or translation errors occur

§Examples

use ssg::{create_log_file, log_arguments};

fn main() -> anyhow::Result<()> {
    let mut log_file = create_log_file("./site.log")?;
    let date = ssg::now_iso();

    log_arguments(&mut log_file, &date)?;
    println!("Arguments logged successfully");
    Ok(())
}