pub struct LogConfig {
pub filter: String,
pub stdout: bool,
pub file: Option<PathBuf>,
pub rotate: LogRotate,
}Expand description
Tracing install options (stdout and/or file).
Fields§
§filter: StringEnvFilter directive (e.g. sova=info, debug).
stdout: boolWrite to stdout (default true).
file: Option<PathBuf>Optional log file path.
rotate: LogRotateFile rotation policy (used when file is set).
Implementations§
Source§impl LogConfig
impl LogConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Build from environment variables (see crate / README logging section).
Sourcepub fn install(&self)
pub fn install(&self)
Install the subscriber (try_init). No-op if SOVA_LOG=off or a subscriber already exists.
Sourcepub fn try_install(&self) -> Result<(), String>
pub fn try_install(&self) -> Result<(), String>
Like Self::install, but returns whether init succeeded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogConfig
impl RefUnwindSafe for LogConfig
impl Send for LogConfig
impl Sync for LogConfig
impl Unpin for LogConfig
impl UnsafeUnpin for LogConfig
impl UnwindSafe for LogConfig
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