| Crates.io | caplog |
| lib.rs | caplog |
| version | 0.3.0 |
| created_at | 2021-06-01 15:07:42.280273+00 |
| updated_at | 2025-04-14 20:41:34.287058+00 |
| description | Capture log messages for testing |
| homepage | |
| repository | https://github.com/Alex-Addy/caplog/ |
| max_upload_size | |
| id | 404763 |
| size | 33,517 |
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"));
}