mxo_env_logger 0.1.0

Another env_logger wrapped.
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 9.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.71 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • biluohc

Build status Latest version All downloads Downloads of latest version Documentation

mxo_env_logger

Another env_logger wrapped.

Cargo.toml:

[dependencies]
mxo_env_logger = "^0.1"
log = "^0.3.8"

Code:

#[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));
}

Output:

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