Add log variable to justfile (#621)

Allows logging to be controlled with, for example:

    just log=trace run
This commit is contained in:
Casey Rodarmor 2020-03-31 00:00:05 -07:00 committed by GitHub
parent 1f8c230512
commit f73de24fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 15 deletions

View File

@ -10,12 +10,19 @@ bt := '0'
export RUST_BACKTRACE := bt export RUST_BACKTRACE := bt
log := "warn"
export JUST_LOG := log
test: test:
cargo test cargo test
fuzz: fuzz:
cargo +nightly fuzz run fuzz-compiler cargo +nightly fuzz run fuzz-compiler
run:
cargo run
@spam: @spam:
{ \ { \
figlet test; \ figlet test; \

View File

@ -29,7 +29,7 @@ pub(crate) use crate::{node::Node, tree::Tree};
pub(crate) use derivative::Derivative; pub(crate) use derivative::Derivative;
pub(crate) use edit_distance::edit_distance; pub(crate) use edit_distance::edit_distance;
pub(crate) use libc::EXIT_FAILURE; pub(crate) use libc::EXIT_FAILURE;
pub(crate) use log::warn; pub(crate) use log::{info, warn};
pub(crate) use snafu::{ResultExt, Snafu}; pub(crate) use snafu::{ResultExt, Snafu};
pub(crate) use unicode_width::UnicodeWidthChar; pub(crate) use unicode_width::UnicodeWidthChar;

View File

@ -13,6 +13,7 @@ pub fn run() -> Result<(), i32> {
let app = Config::app(); let app = Config::app();
info!("Parsing command line arguments…");
let matches = app.get_matches(); let matches = app.get_matches();
let config = Config::from_matches(&matches).eprint(Color::auto())?; let config = Config::from_matches(&matches).eprint(Color::auto())?;