From e89a61498cd966c1488dfddf6a6fdb2db888fe0d Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sun, 10 Jul 2022 21:55:45 +0200 Subject: [PATCH] Add env_logger --- Cargo.lock | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 1 + 3 files changed, 51 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 0624152..8730d60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,6 +124,7 @@ name = "actix-test" version = "0.0.0" dependencies = [ "actix-web", + "env_logger", "image", "num-traits", "percent-encoding", @@ -239,6 +240,17 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -484,6 +496,19 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "exr" version = "1.4.2" @@ -671,6 +696,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "idna" version = "0.2.3" @@ -1259,6 +1290,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + [[package]] name = "threadpool" version = "1.8.1" @@ -1492,6 +1532,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index f37ccb1..b7ea261 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +env_logger = "0.9.0" num-traits = "0.2.15" actix-web = "4.1.0" image = "0.24.2" diff --git a/src/main.rs b/src/main.rs index 96cb1b3..ca0b17a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -120,6 +120,7 @@ async fn img_gen1(req: HttpRequest, path: web::Path<(u32, u32, u32)>) -> Result< #[actix_web::main] // or #[tokio::main] async fn main() -> std::io::Result<()> { + env_logger::init(); HttpServer::new(|| { App::new() .service(greet) -- 2.34.1