From 87007c7e324ad814d4d153a23cb598174c43252c Mon Sep 17 00:00:00 2001 From: tgotwig Date: Sat, 14 Sep 2019 14:08:27 +0200 Subject: Add `log` and `env_logger` Relates #7 --- .gitignore | 2 +- Cargo.toml | 2 ++ examples/tour/main.rs | 3 +++ src/lib.rs | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2f88dbac..69369904 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /target **/*.rs.bk -Cargo.lock \ No newline at end of file +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 1e806b22..d1c7e9dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ features = ["winit"] [dependencies] stretch = "0.2" twox-hash = "1.5" +log = "0.4.8" # Enable to obtain conversion traits winit = { version = "0.20.0-alpha3", optional = true } @@ -28,3 +29,4 @@ winit = { version = "0.20.0-alpha3", optional = true } # A personal `ggez` fork that introduces a `FontCache` type to measure text # efficiently and fixes HiDPI issues. ggez = { version = "0.5", git = "https://github.com/hecrj/ggez.git" } +env_logger = "0.6.2" diff --git a/examples/tour/main.rs b/examples/tour/main.rs index 571bc2e2..06b482a7 100644 --- a/examples/tour/main.rs +++ b/examples/tour/main.rs @@ -12,6 +12,8 @@ use ggez::filesystem; use ggez::graphics; use ggez::input::mouse; +extern crate env_logger; + pub fn main() -> ggez::GameResult { let (context, event_loop) = { &mut ggez::ContextBuilder::new("iced", "ggez") @@ -33,6 +35,7 @@ pub fn main() -> ggez::GameResult { true, ); + env_logger::init(); let state = &mut Game::new(context)?; event::run(context, event_loop, state) diff --git a/src/lib.rs b/src/lib.rs index c1c18b41..2c9fe6c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -196,6 +196,7 @@ #![deny(unused_results)] #![deny(unsafe_code)] #![deny(rust_2018_idioms)] +#[macro_use] extern crate log; pub mod input; pub mod renderer; pub mod widget; -- cgit