From 0cb5e0b2caba61bbcf6f57ce58506882766d5eea Mon Sep 17 00:00:00 2001 From: Kirawi Date: Sat, 23 Oct 2021 08:52:18 -0400 Subject: log syntax highlighting init errors (#895) --- helix-term/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'helix-term/src') diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index 180dacd1..2589a375 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -16,6 +16,11 @@ fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> { }; // Separate file config so we can include year, month and day in file logs + let file = std::fs::OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(logpath)?; let file_config = fern::Dispatch::new() .format(|out, message, record| { out.finish(format_args!( @@ -26,7 +31,7 @@ fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> { message )) }) - .chain(fern::log_file(logpath)?); + .chain(file); base_config.chain(file_config).apply()?; -- cgit v1.2.3-70-g09d2