revert log truncation (#895) (#1130)

imgbot
Kirawi 3 years ago committed by GitHub
parent 2b7c086653
commit ed76cdf238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,11 +16,6 @@ fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
}; };
// Separate file config so we can include year, month and day in file logs // 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() let file_config = fern::Dispatch::new()
.format(|out, message, record| { .format(|out, message, record| {
out.finish(format_args!( out.finish(format_args!(
@ -31,7 +26,7 @@ fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
message message
)) ))
}) })
.chain(file); .chain(fern::log_file(logpath)?);
base_config.chain(file_config).apply()?; base_config.chain(file_config).apply()?;

Loading…
Cancel
Save