Remove old file if it was present

This commit is contained in:
Ayaz Hafiz 2022-08-23 15:42:54 -05:00
parent 3b2e3d515f
commit eec16fc0ff
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -54,6 +54,7 @@ impl TracingGuards {
#[must_use]
pub fn setup_tracing() -> TracingGuards {
if let Ok(file) = std::env::var(LOGTO_VAR) {
let _ = std::fs::remove_file(&file);
let file_appender = tracing_appender::rolling::never(".", file);
let (non_blocking, guard) = tracing_appender::non_blocking(file_appender);
let file_layer = fmt::Layer::default()