From 5b151feffab3a41646ae169f6cfd910e9b8ed9a9 Mon Sep 17 00:00:00 2001 From: Conrad Vermeulen Date: Tue, 2 Jan 2024 16:16:12 +0000 Subject: [PATCH 1/3] Add logging support --- contrib/MVCFramework.View.Renderers.Sempare.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/MVCFramework.View.Renderers.Sempare.pas b/contrib/MVCFramework.View.Renderers.Sempare.pas index c59f4655..d7fc130e 100644 --- a/contrib/MVCFramework.View.Renderers.Sempare.pas +++ b/contrib/MVCFramework.View.Renderers.Sempare.pas @@ -44,6 +44,7 @@ interface uses MVCFramework, MVCFramework.Commons, + MVCFramework.Logger, System.Classes, Sempare.Template; @@ -91,7 +92,7 @@ begin except on e: Exception do begin - writeln(e.Message); // not the most ideal way of doing things... we would want to use a logger + Log.ErrorFmt('[%s] %s', [e.Classname, e.Message], LOGGERPRO_TAG); raise e; end; end; From 6e99ace3432a98a9d0ce0dda2c86ec61b1aea115 Mon Sep 17 00:00:00 2001 From: Conrad Vermeulen Date: Tue, 2 Jan 2024 16:28:59 +0000 Subject: [PATCH 2/3] Force loading from file --- samples/serversideviews_sempare/ServerSideViewsSempare.dpr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/serversideviews_sempare/ServerSideViewsSempare.dpr b/samples/serversideviews_sempare/ServerSideViewsSempare.dpr index c91bb4a9..1d55087d 100644 --- a/samples/serversideviews_sempare/ServerSideViewsSempare.dpr +++ b/samples/serversideviews_sempare/ServerSideViewsSempare.dpr @@ -10,6 +10,7 @@ uses Winapi.ShellAPI, Winapi.Windows, {$ENDIF } + Sempare.Template, IdHTTPWebBrokerBridge, Web.WebReq, Web.WebBroker, @@ -27,6 +28,7 @@ procedure RunServer(APort: Integer); var LServer: TIdHTTPWebBrokerBridge; begin + TTemplateRegistry.Instance.LoadStrategy := [tlsLoadFile]; ReportMemoryLeaksOnShutdown := True; Writeln(Format('Starting HTTP Server on port %d', [APort])); LServer := TIdHTTPWebBrokerBridge.Create(nil); From ff6e0cff2aef40edaec3b91bf58212480a0e33d0 Mon Sep 17 00:00:00 2001 From: Conrad Vermeulen Date: Tue, 2 Jan 2024 16:36:29 +0000 Subject: [PATCH 3/3] Use a non-deprecated error logging function --- contrib/MVCFramework.View.Renderers.Sempare.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/MVCFramework.View.Renderers.Sempare.pas b/contrib/MVCFramework.View.Renderers.Sempare.pas index d7fc130e..105854e3 100644 --- a/contrib/MVCFramework.View.Renderers.Sempare.pas +++ b/contrib/MVCFramework.View.Renderers.Sempare.pas @@ -92,7 +92,7 @@ begin except on e: Exception do begin - Log.ErrorFmt('[%s] %s', [e.Classname, e.Message], LOGGERPRO_TAG); + Log.Error('[%s] %s', [e.Classname, e.Message], LOGGERPRO_TAG); raise e; end; end;