From 91cd665671d564620bce13e693cd7ecaad697db9 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Sun, 25 Feb 2024 15:27:54 +0100 Subject: Closes #11. Write log to file. Update deps --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index eae89f6..d17984f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,7 +33,11 @@ async fn main() -> color_eyre::eyre::Result<()> { time::macros::format_description!("[year]-[month]-[day] [hour]:[minute]:[second]"); let loc = UtcTime::new(time_format); + let file_appender = tracing_appender::rolling::daily("logs", "webol.log"); + let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender); + tracing_subscriber::registry() + .with(fmt::layer().with_writer(non_blocking).with_ansi(false)) .with(fmt::layer().with_timer(loc)) .with( EnvFilter::builder() -- cgit v1.2.3