https://github.com/imotai/uselog_rs
use log for outputing log in test and not test mode with one line code
https://github.com/imotai/uselog_rs
log println rust unittests
Last synced: 2 months ago
JSON representation
use log for outputing log in test and not test mode with one line code
- Host: GitHub
- URL: https://github.com/imotai/uselog_rs
- Owner: imotai
- License: apache-2.0
- Created: 2022-03-29T09:39:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-29T10:42:18.000Z (about 3 years ago)
- Last Synced: 2025-01-13T00:18:55.499Z (4 months ago)
- Topics: log, println, rust, unittests
- Language: Rust
- Homepage: https://docs.rs/uselog-rs
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uselog_rs
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;
```