rfdoell / caplog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"));
}

About

License:Apache License 2.0


Languages

Language:Rust 100.0%