Old Write* to LogI and LogException

This commit is contained in:
Daniele Teti 2024-07-09 23:22:26 +02:00
parent c420be5f24
commit d5156646ea
2 changed files with 7 additions and 7 deletions

View File

@ -26,7 +26,7 @@ procedure RunServer(APort: Integer);
var var
LServer: TIdHTTPWebBrokerBridge; LServer: TIdHTTPWebBrokerBridge;
begin begin
Writeln('** DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION); LogI('** DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION);
LServer := TIdHTTPWebBrokerBridge.Create(nil); LServer := TIdHTTPWebBrokerBridge.Create(nil);
try try
@ -35,7 +35,7 @@ begin
LServer.MaxConnections := 0; LServer.MaxConnections := 0;
LServer.ListenQueue := 200; LServer.ListenQueue := 200;
LServer.Active := True; LServer.Active := True;
Write('CTRL+C to Quit'); LogI('CTRL+C to Quit');
WaitForTerminationSignal; WaitForTerminationSignal;
finally finally
LServer.Free; LServer.Free;
@ -55,7 +55,7 @@ begin
RunServer(8080); RunServer(8080);
except except
on E: Exception do on E: Exception do
Writeln(E.ClassName, ': ', E.Message); LogException(E, 'Shutdown');
end; end;
end. end.

View File

@ -33,7 +33,7 @@ var
LCmd: string; LCmd: string;
lURL: string; lURL: string;
begin begin
Writeln('** DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION); LogI('** DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION);
LCmd := 'start'; LCmd := 'start';
if ParamCount >= 1 then if ParamCount >= 1 then
LCmd := ParamStr(1); LCmd := ParamStr(1);
@ -52,9 +52,9 @@ begin
http://ww2.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=index.html } http://ww2.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=index.html }
LServer.ListenQueue := 200; LServer.ListenQueue := 200;
lURL := Format('http://localhost:%d', [APort]); lURL := Format('http://localhost:%d', [APort]);
Writeln('SWAGGER UI available at ', lURL); LogI('SWAGGER UI available at ' + lURL);
LServer.Active := True; LServer.Active := True;
Write('CTRL+C to Quit'); LogI('CTRL+C to Quit');
{$IF Defined(MSWINDOWS)} {$IF Defined(MSWINDOWS)}
ShellExecute(0, nil, PChar(lURL), nil, nil, SW_SHOWNOACTIVATE); ShellExecute(0, nil, PChar(lURL), nil, nil, SW_SHOWNOACTIVATE);
{$ENDIF} {$ENDIF}
@ -74,7 +74,7 @@ begin
RunServer(8080); RunServer(8080);
except except
on E: Exception do on E: Exception do
Writeln(E.ClassName, ': ', E.Message); LogException(E, E.Message);
end; end;
end. end.