pub struct Logger;Available on crate feature
terminal only.Expand description
Initializes the process logger from the shared log flags.
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn try_init(log: &LogFlags) -> Result<()>
pub fn try_init(log: &LogFlags) -> Result<()>
Initialises env_logger from log. When LogFlags::file
is set the log target is opened in append mode (creating it
if missing) and used for output; otherwise logs go to stderr
as usual.
Opening the log file is fallible: if the caller asked for one but we cannot create or open it, the error is returned rather than silently falling back to stderr and polluting interactive prompts.
Auto Trait Implementations§
impl Freeze for Logger
impl RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl UnsafeUnpin for Logger
impl UnwindSafe for Logger
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