Skip to main content

try_init

Function try_init 

Source
pub fn try_init() -> Result<(), TryInitError>
Expand description

Try to initialize the logging system.

Returns Ok(()) if successful, or Err if logging has already been initialized.

This is the whole implementation; init is this plus a panic. The two used to assemble the same filter and the same layer separately, and a change to either had to be made twice — the with_ansi(false) above is there because that is exactly what happened once already.