caplog

Crates.iocaplog
lib.rscaplog
version0.2.0
sourcesrc
created_at2021-06-01 15:07:42.280273
updated_at2021-07-07 14:18:54.976561
descriptionCapture log messages for testing
homepage
repositoryhttps://github.com/Alex-Addy/caplog/
max_upload_size
id404763
size33,906
Alex Addy (Alex-Addy)

documentation

README

caplog

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.

Usage

use log::warn;

#[test]
fn test_scramble_message() {
   let handle = caplog::get_handle();
   warn!("scrambled eggs");
   assert!(handle.any_msg_contains("scrambled eggs"));
}
Commit count: 29

cargo fmt