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

lholznagel/morgan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 git@github.com: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

About

Simple logger mostly controlled by env variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages