write_to_debug_file

Function write_to_debug_file 

Source
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 file
  • content - Content to write to the log file
  • header - Optional header to include before the content
  • context - 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");