dev-logger

Crates.iodev-logger
lib.rsdev-logger
version0.1.0
sourcesrc
created_at2023-10-21 16:44:58.386364
updated_at2023-10-21 16:44:58.386364
descriptionBased on `env_logger` but no need to set env.
homepage
repository
max_upload_size
id1010108
size98,069
Junzhuo ZHOU (zao111222333)

documentation

README

Dev-logger

Based on env_logger but no need to set env.

Basic

basic examples/basic.rs:

use dev_logger;
#[macro_use]
extern crate log;

fn main() {
  dev_logger::init();
  function();
}

#[test]
fn test() {
  dev_logger::init();
  function();
}

fn function() {
  error!("error");
  warn!("warn");
  info!("info");
  debug!("debug");
  trace!("trace");
}

Trace

trace examples/trace.rs:

use dev_logger;
#[macro_use]
extern crate log;

fn main() {
  dev_logger::init_trace();
  function();
}

#[test]
fn test() {
  dev_logger::init_trace();
  function();
}

fn function() {
  error!("error");
  warn!("warn");
  info!("info");
  debug!("debug");
  trace!("trace");
}
Commit count: 0

cargo fmt