(&self)
| 36 | } |
| 37 | |
| 38 | pub fn disable(&self) { |
| 39 | if let Ok(mut file) = self.lock_file() { |
| 40 | *file = None; |
| 41 | self.file.0.store(true, Ordering::Relaxed); |
| 42 | |
| 43 | // Trigger a write call to disable the current file in the LogWriter |
| 44 | debug!("disable log file writer"); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | fn lock_file(&self) -> io::Result<MutexGuard<'_, Option<BufWriter<File>>>> { |
| 49 | self.file.1.lock().map_err(|_| io::Error::other("Mutex lock failed")) |
no test coverage detected