From 5b6ab5c1a889f3d1917ddf19de2b7cb973cb6485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20R=C3=A5gstad?= Date: Sun, 15 Oct 2023 16:37:11 +0200 Subject: [PATCH] Improve route map logging --- src/engine/runtime.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/engine/runtime.rs b/src/engine/runtime.rs index 497a6f2..2a80cd2 100644 --- a/src/engine/runtime.rs +++ b/src/engine/runtime.rs @@ -175,7 +175,22 @@ impl WXRuntime { Err(err) => error_code(format!("(Runtime) {}", err.message), err.code), } if self.mode == WXMode::Dev { - dbg!(&self.routes); // TODO: Remove this line + // Print the route map in dev mode. + info(self.mode, "Route map:"); + let mut routes: Vec<(&Method, &WXUrlPath)> = self + .routes + .0 + .iter() + .flat_map(|(method, method_map)| { + method_map + .iter() + .map(|(path, _)| (method, path)) + .collect::>() + }) + .collect(); + for (method, path) in routes { + println!(" - {} {}", method, path); + } } }