Closed Thomasdezeeuw closed 3 years ago
In log we borrow a RefCell and unwrap the result: https://github.com/Thomasdezeeuw/std-logger/blob/20e4307d85cd9e0c418674dab607ab33e75d9c55/src/lib.rs#L429
log
RefCell
unwrap
Somewhere in a double panic this lead to an aborted process on macOS while developing another crate. Two points to fix:
borrow_mut
Buffer
log_failure
This happens if a part of the log message panics. For example:
struct T; impl fmt::Display for T { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { panic!() } } info!("T: {}", T);
In
log
we borrow aRefCell
andunwrap
the result: https://github.com/Thomasdezeeuw/std-logger/blob/20e4307d85cd9e0c418674dab607ab33e75d9c55/src/lib.rs#L429Somewhere in a double panic this lead to an aborted process on macOS while developing another crate. Two points to fix:
borrow_mut
call, instead create a newBuffer
.log_failure
.