| Crates.io | stderr |
| lib.rs | stderr |
| version | 0.8.0 |
| created_at | 2016-12-25 13:40:06.932755+00 |
| updated_at | 2017-08-09 13:57:39.926512+00 |
| description | A library that using macro to write to io::stderr() like print!()/println!(). |
| homepage | |
| repository | https://github.com/biluohc/stderr |
| max_upload_size | |
| id | 7766 |
| size | 33,243 |
A library that using macro to write to io::stderr() like print!()/println!() for rust.
On Cargo.toml:
[dependencies]
stderr = "0.8.0"
Usage as same as print!/println!.
err!/errln!: Panics if writing to io::stderr() fails.
errst!/errstln!: Do nothing if writing to io::stderr() fails(silent->st).
#[macro_use]
extern crate stderr;
fn main() {
println!("err!/errln!/errst!/errstln!()@stderr !");
let vec = vec![1, 2, 3, 4, 5];
let s = std::env::args().nth(0).unwrap();
err!("err!(expr\\n)\n");
err!("err!(String: vec![1, 2, 3, 4, 5])\n{}: {:?}", s, vec);
errln!();
errln!("errln!(expr)");
println!();
errst!("errst!(expr\\n)\n");
errst!("errst!(String: vec![1, 2, 3, 4, 5])\n{}: {:?}", s, vec);
errstln!();
errstln!("errstln!(expr)");
}
errxxx and don't want be polluted by other macros, you can:On Cargo.toml:
[dependencies]
stderr = "0.3.0"
macro_useOn Code:
#[macro_use(err,errln,errst,errstln)]
extern crate stderr;
StaticMut or log::*, please read document2017-0530 0.8.0 log::*, StaticMut
2017-0424 0.7.1 loc!() and Loger::init(module_path!())
2017-0211 0.7.0 Supports multiple packages.
2017-0126 0.6.1 Don't repeat initialization,fix #2.
2017-0126 0.6.0 Refactoring and update API to stderr::Loger; init!(),db!(),dbln!(),dbst!(),dbstln!() for LOG=module_path!() and --log/-log module_path!(),add Documentation.
2017-0116 0.5.0 Add stderr::loger::Loger;init(), debug!(),debugln!(),debugst!(),debugstln!() for LOG=debug and --log/-log debug.