Function log_to_file

Source
pub fn log_to_file(now: &str, message: &str) -> Result<()>
Expand description

ยงlog_to_file

The log_to_file function takes two arguments: now and message.

  • The now argument is a string representing the current time and the message argument is the message to be logged. The function checks if the log path is empty. If it is, it creates a new filename using the current date. If the log path is not empty, it joins the log path with the filename. The function then creates a new file at the specified path using the OpenOptions struct and writes the message to the file.