Function multipart::mock::log_on_panic [] [src]

pub fn log_on_panic() -> PanicLogger

Capture all logging on this thread during PanicLogger's lifetime.

When PanicLogger is dropped: if the thread is panicking, all captured logs are printed to stdout, otherwise the captured logs are deleted.

RFC: break this functionality out into its own crate? Could also support nested invocations (where each instance of PanicLogger only prints the logs captured during its lifetime) but that's currently unused here.