pub fn write_to_debug_file(
filename: &str,
content: &str,
header: Option<&str>,
context: Option<&str>,
) -> Result<()>Expand description
Writes content to a debug log file with optional header and context information.
§Parameters
filename- Name of the log filecontent- Content to write to the log fileheader- Optional header to include before the contentcontext- Optional context information (typically file and line number)
§Returns
std::io::Result<()> indicating success or failure
§Examples
write_to_debug_file(
"debug.log",
"Something happened",
Some("INFO"),
Some("main.rs:42")
).expect("Failed to write to log");