Crates.io | caplog |
lib.rs | caplog |
version | 0.2.0 |
source | src |
created_at | 2021-06-01 15:07:42.280273 |
updated_at | 2021-07-07 14:18:54.976561 |
description | Capture log messages for testing |
homepage | |
repository | https://github.com/Alex-Addy/caplog/ |
max_upload_size | |
id | 404763 |
size | 33,906 |
A Rust library providing log capture facilities for testing.
This crate is primarily intended for use with the
log
crate, however additional logging
facilities are welcome.
use log::warn;
#[test]
fn test_scramble_message() {
let handle = caplog::get_handle();
warn!("scrambled eggs");
assert!(handle.any_msg_contains("scrambled eggs"));
}