mirror of
https://github.com/eternal-flame-AD/unitdc-rs.git
synced 2025-03-20 13:39:23 -05:00
add env_logger in cli version
This commit is contained in:
parent
624b6fb8c9
commit
9ace779326
2 changed files with 2 additions and 0 deletions
|
@ -6,4 +6,5 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
env_logger = "0.10.0"
|
||||||
unitdc = { path = "../../" }
|
unitdc = { path = "../../" }
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use unitdc::interpreter::{Interpreter, Output};
|
use unitdc::interpreter::{Interpreter, Output};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
env_logger::init();
|
||||||
let mut interpreter = Interpreter::new(Box::new(|output| match output {
|
let mut interpreter = Interpreter::new(Box::new(|output| match output {
|
||||||
Output::Message(e) => eprintln!("message: {}", e),
|
Output::Message(e) => eprintln!("message: {}", e),
|
||||||
Output::Quantity(q) => println!("[0]: {}", q),
|
Output::Quantity(q) => println!("[0]: {}", q),
|
||||||
|
|
Loading…
Add table
Reference in a new issue