caplog

Crates.iocaplog
lib.rscaplog
version0.3.0
created_at2021-06-01 15:07:42.280273+00
updated_at2025-04-14 20:41:34.287058+00
descriptionCapture log messages for testing
homepage
repositoryhttps://github.com/Alex-Addy/caplog/
max_upload_size
id404763
size33,517
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: 32

cargo fmt