From 5cede7e92ab17ad51e93db7ad2b00edd88bf0cbd Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Wed, 19 May 2021 23:53:42 +0200 Subject: [PATCH] refactor: log info for compression & dir listing features --- sample.env | 5 ++++- src/server.rs | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sample.env b/sample.env index 357a9ca..8b9a409 100644 --- a/sample.env +++ b/sample.env @@ -3,4 +3,7 @@ E_ARGS = "--port=8787" # Server configuration SERVER_LOG_LEVEL = "trace" -SERVER_COMPRESSION = "gzip" +SERVER_ROOT = "public" +# SERVER_PORT = 8787 +SERVER_COMPRESSION = true +SERVER_DIRECTORY_LISTING = true diff --git a/src/server.rs b/src/server.rs index 701993b..4751a7e 100644 --- a/src/server.rs +++ b/src/server.rs @@ -56,7 +56,7 @@ impl Server { logger::init(&opts.log_level)?; - tracing::info!("runtime worker threads {}", self.threads); + tracing::info!("runtime worker threads: {}", self.threads); let ip = opts.host.parse::()?; let addr = SocketAddr::from((ip, opts.port)); @@ -75,11 +75,13 @@ impl Server { // TODO: CORS support - // Directory listing option - let dir_listing = opts.directory_listing; - // Auto compression based on the `Accept-Encoding` header let compression = opts.compression; + tracing::info!("auto compression compression: enabled={}", compression); + + // Directory listing option + let dir_listing = opts.directory_listing; + tracing::info!("directory listing: enabled={}", dir_listing); // Spawn a new Tokio asynchronous server task with its given options let threads = self.threads; -- libgit2 1.7.2