#[non_exhaustive]pub enum InitError {
AlreadyInstalled,
Filter(BuildError),
}Available on crate feature
std only.Expand description
Error returned by init_json, init_logfmt and init_human.
§Examples
match log_io::init_json() {
Ok(_guard) => { /* keep the guard alive in `main` */ }
Err(log_io::InitError::AlreadyInstalled) => { /* someone else set it */ }
Err(e) => eprintln!("logging not started: {e}"),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AlreadyInstalled
A global logger is already installed.
Filter(BuildError)
The LOG_IO environment variable is set but did not parse.
Trait Implementations§
Source§impl Error for InitError
impl Error for InitError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Forget for InitError
impl Freeze for InitError
impl Move for InitError
impl RefUnwindSafe for InitError
impl Send for InitError
impl Sync for InitError
impl Unpin for InitError
impl UnsafeUnpin for InitError
impl UnwindSafe for InitError
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