Crates.io | uselog-rs |
lib.rs | uselog-rs |
version | 0.3.0 |
source | src |
created_at | 2022-03-29 10:11:13.718813 |
updated_at | 2022-03-29 10:42:29.125428 |
description | use log for outputing log in test and not test mode with one line code |
homepage | https://rtstore.io |
repository | |
max_upload_size | |
id | 558456 |
size | 16,075 |
before using uselog_rs
, you must use four lines code to use log for outputing log in test mode
and not test mode
#[cfg(not(test))]
use log::{debug, info, warn};
#[cfg(test)]
use std::{println as debug, println as info, println as warn};
now just one line code
uselog!(debug, info, warn)
but you need to add uselog_rs
to your parent module first like
#[macro_use(uselog)]
extern crate uselog_rs;