pub struct LogGuard { /* private fields */ }Expand description
Held by the caller for the life of the process. Dropping it flushes the file writer (SPEC §4.4); it also exposes runtime level control (SPEC §5) and whether the file sink degraded.
Implementations§
Source§impl LogGuard
impl LogGuard
Sourcepub fn log_dir(&self) -> &Path
pub fn log_dir(&self) -> &Path
The resolved log directory this run is writing to. When file_error is
set, nothing is being written there — the directory is the one that could NOT be opened.
Sourcepub fn file_error(&self) -> Option<&str>
pub fn file_error(&self) -> Option<&str>
Why the JSONL file sink is disabled, or None when it is live. Console logging is installed
either way; a consumer that surfaces logging health reports this rather than treating it as
a fatal init failure.
Sourcepub fn set_filter(&self, directive: &str) -> Result<()>
pub fn set_filter(&self, directive: &str) -> Result<()>
Swap the live level filter (SPEC §5 runtime reload). The consumer’s control plane calls this.
Auto Trait Implementations§
impl !RefUnwindSafe for LogGuard
impl !UnwindSafe for LogGuard
impl Freeze for LogGuard
impl Send for LogGuard
impl Sync for LogGuard
impl Unpin for LogGuard
impl UnsafeUnpin for LogGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more