Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Latest commit

 

History

History
49 lines (34 loc) · 971 Bytes

README.md

File metadata and controls

49 lines (34 loc) · 971 Bytes

Morgan

Morgan is a light weight implementation on top of the log crate.

Instead of showing the current time in the log, it shows the time since application startup in seconds.

Usage

Run:

git submodule add [email protected]:lholznagel/morgan.git

Cargo.toml:

morgan = { path = "../morgan" }

Code:

use morgan::Morgan;

fn main() {
    Morgan::init(Vec::new()); // or vec!["dependency_to_ignore_logs_from"]

    log::error!("My error message");
    log::warn!("My warn message");
    log::info!("My info message");
    log::debug!("Will not be shown");
    log::trace!("Will not be shown");
}

Defaults

  • Log level: INFO
  • Color output: true
  • Crates excluded: []

Env

  • MORGAN_LEVEL=debug changes the log level to debug
  • MORGAN_COLOR=false disables color output

Example output

morgan