From 3418adb06ad426bbcd13d2461af59591bf88ceb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sun, 6 Jan 2019 15:01:09 +0100 Subject: [PATCH] feat: Add log libraries dependencies --- Cargo.toml | 2 ++ examples/create-database.rs | 1 + examples/query-database.rs | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 02b3e10d4..115600bc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ hashbrown = { version = "0.1", features = ["serde"] } lazy_static = "1.1" levenshtein_automata = { version = "0.1", features = ["fst_automaton"] } linked-hash-map = { version = "0.5", features = ["serde_impl"] } +log = "0.4" sdset = "0.3" serde = "1.0" serde_derive = "1.0" @@ -41,6 +42,7 @@ nightly = ["hashbrown/nightly", "group-by/nightly"] [dev-dependencies] csv = "1.0" elapsed = "0.1" +env_logger = "0.6" jemallocator = "0.1" quickcheck = "0.7" rand = "0.6" diff --git a/examples/create-database.rs b/examples/create-database.rs index 319e04acb..ac86d2621 100644 --- a/examples/create-database.rs +++ b/examples/create-database.rs @@ -66,6 +66,7 @@ fn index(schema: Schema, database_path: &Path, csv_data_path: &Path) -> Result Result<(), Box> { + let _ = env_logger::init(); let opt = Opt::from_args(); let schema = { diff --git a/examples/query-database.rs b/examples/query-database.rs index edd311f16..20c04aca9 100644 --- a/examples/query-database.rs +++ b/examples/query-database.rs @@ -76,6 +76,7 @@ fn create_highlight_areas(text: &str, matches: &[Match], attribute: SchemaAttr) } fn main() -> Result<(), Box> { + let _ = env_logger::init(); let opt = Opt::from_args(); let (elapsed, result) = elapsed::measure_time(|| Database::open(&opt.database_path)); @@ -136,7 +137,7 @@ fn main() -> Result<(), Box> { println!(); } - println!("===== Found {} results in {} =====", number_of_documents, elapsed); + eprintln!("===== Found {} results in {} =====", number_of_documents, elapsed); buffer.clear(); }