From b347cd609e3baf4e6ebde5802696f4184551d76a Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Sun, 2 Apr 2023 12:33:05 +0200 Subject: [PATCH] Added logging config. --- gymboard-uploads/.gitignore | 2 ++ gymboard-uploads/source/app.d | 6 ++++++ gymboard-uploads/source/handlers.d | 1 + 3 files changed, 9 insertions(+) diff --git a/gymboard-uploads/.gitignore b/gymboard-uploads/.gitignore index f93d37f..f4840d0 100644 --- a/gymboard-uploads/.gitignore +++ b/gymboard-uploads/.gitignore @@ -14,3 +14,5 @@ gymboard-uploads-test-* *.o *.obj *.lst + +temp-uploads/ diff --git a/gymboard-uploads/source/app.d b/gymboard-uploads/source/app.d index 20a5e56..836e16d 100644 --- a/gymboard-uploads/source/app.d +++ b/gymboard-uploads/source/app.d @@ -1,10 +1,16 @@ import std.stdio; import handy_httpd; import handy_httpd.handlers.path_delegating_handler; +import slf4d; +import slf4d.default_provider; import handlers; void main() { + // Configure logging + auto provider = new shared DefaultProvider(true, Levels.TRACE); + configureLoggingProvider(provider); + PathDelegatingHandler pathHandler = new PathDelegatingHandler(); pathHandler.addMapping("GET", "/status", (ref HttpRequestContext ctx) { ctx.response.writeBodyString("online"); diff --git a/gymboard-uploads/source/handlers.d b/gymboard-uploads/source/handlers.d index 439ab3e..71ae37d 100644 --- a/gymboard-uploads/source/handlers.d +++ b/gymboard-uploads/source/handlers.d @@ -1,6 +1,7 @@ module handlers; import handy_httpd; +import handy_httpd.util.range; import slf4d; import std.conv : to; import std.path;