sfackler / rust-log-panics

Apache License 2.0
54 stars 15 forks source link

double panic if log::error! panics #16

Open danielnorberg opened 3 months ago

danielnorberg commented 3 months ago

Thank you for this library!

We use the rust tracing crate and ran into an issue where the panic hook itself panics on invoking log::error! when tracing is in a broken state.

First a tracing macro would panic, causing the panic hook to get invoked and then the panic hook panicked, yielding:

thread panicked while processing panic. aborting.

Could it make sense to fall back to e.g. eprintln! if log::error! panics?

sfackler commented 3 months ago

How would that be implemented?

danielnorberg commented 3 months ago

Not sure, is it possible to catch a panic in the panic hook or does that second panic cause an immediate abort?

sfackler commented 3 months ago

It is an immediate abort.