Function caplog::get_handle[][src]

pub fn get_handle() -> CaplogHandle
Expand description

Get a handle to the recorded logs. Handle is bounded to only viewing the logs available while it is alive.

Example

info!("not recorded");
let handle = caplog::get_handle();
info!("recorded");
assert!(handle.iter().any(|rec| rec.msg.contains("not recorded")) == false);
assert!(handle.any_msg_contains("recorded"));