Write a single log entry to the file, followed by a flush. Returns an error if either the write or flush fails.
(file: &mut File, line: &str)
| 243 | /// |
| 244 | /// Returns an error if either the write or flush fails. |
| 245 | fn write_entry(file: &mut File, line: &str) -> io::Result<()> { |
| 246 | writeln!(file, "{}", line)?; |
| 247 | file.flush() |
| 248 | } |