Add env_logger
authorMegaBrutal <code+git@megabrutal.com>
Sun, 10 Jul 2022 19:55:45 +0000 (21:55 +0200)
committerMegaBrutal <code+git@megabrutal.com>
Sun, 10 Jul 2022 19:55:45 +0000 (21:55 +0200)
Cargo.lock
Cargo.toml
src/main.rs

index 0624152634ebd46bcefb188b59008e98ea831b77..8730d60c0e41b389d3ec0916002c9e94a6a4d837 100644 (file)
@@ -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"
index f37ccb1aaf70471a1fbff2d3a53706a62687243b..b7ea261210545f767b7db908bbb00ded7bdeb750 100644 (file)
@@ -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"
index 96cb1b30d025f21f1161d000d766ec2acc04c72d..ca0b17a4e70f9294ff2799f94a9ae52479b00c1b 100644 (file)
@@ -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)