From a599b19370957a952c22997c0aa19b565bba6f02 Mon Sep 17 00:00:00 2001 From: Esper Thomson Date: Thu, 3 Oct 2024 04:08:37 -0400 Subject: [PATCH] Add comments. --- astro_modloader/src/logging.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/astro_modloader/src/logging.rs b/astro_modloader/src/logging.rs index f27f288..e72349b 100644 --- a/astro_modloader/src/logging.rs +++ b/astro_modloader/src/logging.rs @@ -7,6 +7,7 @@ use log::{Level, LevelFilter, Log, Metadata, Record, SetLoggerError}; #[derive(Debug)] struct SimpleLogger { + // Synchronize log entries file: Mutex>, } @@ -18,6 +19,7 @@ impl SimpleLogger { } fn lock(&self, f: impl FnOnce(&mut BufWriter) -> T) -> T { + // Ignore log mutex poison let mut guard = match self.file.lock() { Ok(guard) => guard, Err(err) => err.into_inner(), @@ -91,6 +93,7 @@ fn get_logger() -> &'static SimpleLogger { static LOGGER: OnceLock = OnceLock::new(); LOGGER.get_or_init(|| { SimpleLogger::new( + // Open file fs::OpenOptions::new() .write(true) .create(true)