}
fn env_logger_init() {
let mut builder = env_logger::builder();
builder.filter(Some("pijul::commands::git"), log::LevelFilter::Info);
builder.format(|buf, record| {
let target = record.metadata().target();
if target == "pijul::commands::git" {
let mut level_style = buf.style();
level_style.set_color(Color::Green);
writeln!(
buf,
"{} {}",
level_style.value(record.level()),
record.args()
)
} else {
let mut level_style = buf.style();
level_style.set_color(Color::Black).set_intense(true);
let op = level_style.value("[");
let cl = level_style.value("]");
writeln!(
buf,
"{}{} {} {}{} {}",
op,
buf.timestamp(),
buf.default_styled_level(record.level()),
target,
cl,
record.args()
)
}
});
builder.init();