Crates.io | mxo_env_logger |
lib.rs | mxo_env_logger |
version | 0.1.0 |
source | src |
created_at | 2017-11-25 15:18:17.704788 |
updated_at | 2017-11-25 15:18:17.704788 |
description | Another env_logger wrapped. |
homepage | |
repository | https://github.com/biluohc/mxo_env_logger |
max_upload_size | |
id | 40499 |
size | 7,736 |
mxo_env_logger
Another env_logger
wrapped.
[dependencies]
mxo_env_logger = "^0.1"
log = "^0.3.8"
#[macro_use]
extern crate log;
extern crate mxo_env_logger;
use mxo_env_logger::*; // * contains StdErr(std::error::Error), so can use `e.description()` direct.
fn main() {
init();
trace!("Trace her"); // default closed.
info!("Info u");
warn!("Warning her");
error!("Error world!");
std::fs::File::open("Hentai.you").log_err(|e| error!("File open failed: {:?}", e.description()));
std::env::args().nth(1000).ok_or("No 1000 Args").log_err(|e| error!("{}", e));
}
INFO #main::mock:26: Info u
WARN #main::mock:27: Warning her
ERROR#main::mock:28: Error world!
ERROR#main:12: File open failed: "entity not found"
ERROR#main:16: No 1000 Args