From 8f1e63b108ff872b86e0b1be30d85b0cc9b13c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 9 Aug 2022 22:24:45 +0200 Subject: [PATCH] Use log/env_logger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- Cargo.toml | 2 ++ src/main.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 5d76b77..275e614 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,5 +9,7 @@ description = "Keep track of your Hanabi plays and analyse them" [dependencies] chrono = "0.4.20" clap = { version = "3.2.16", features = ["derive"] } +env_logger = "0.9.0" +log = "0.4.17" nom = "7.1.1" rustyline = "10.0.0" diff --git a/src/main.rs b/src/main.rs index c790118..01eb52e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,6 +28,7 @@ use std::io::Write; use chrono::{DateTime, Utc}; use clap::Parser; +use env_logger; use rustyline::{error::ReadlineError, Editor}; fn write_header(filename: &str, players: u8, variants: Vec) -> Result<(), Error> { @@ -56,6 +57,8 @@ fn write_actions(filename: &str, action: GameAction) -> Result<(), Error> { } fn main() -> Result<(), Error> { + env_logger::init(); + let args = Args::parse(); println!( "Hanabi - Players: {} - Variants: {}",