on master help sign in
revert log truncation (#895) (#1130)
ed76cdfKirawi
helix-term/src/main.rs+1−6
@@ -16,11 +16,6 @@ fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
16 };
16 };
17
17
18 // Separate file config so we can include year, month and day in file logs
18 // Separate file config so we can include year, month and day in file logs
19− let file = std::fs::OpenOptions::new()
20− .write(true)
21− .create(true)
22− .truncate(true)
23− .open(logpath)?;
24 let file_config = fern::Dispatch::new()
19 let file_config = fern::Dispatch::new()
25 .format(|out, message, record| {
20 .format(|out, message, record| {
26 out.finish(format_args!(
21 out.finish(format_args!(
@@ -31,7 +26,7 @@ fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
31 message
26 message
32 ))
27 ))
33 })
28 })
34− .chain(file);
29+ .chain(fern::log_file(logpath)?);
35
30
36 base_config.chain(file_config).apply()?;
31 base_config.chain(file_config).apply()?;
37
32