-
Notifications
You must be signed in to change notification settings - Fork 1
/
Server.lpr
48 lines (39 loc) · 961 Bytes
/
Server.lpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
program Server;
{$I mormot.defines.inc}
uses
{$I mormot.uses.inc}
opensslsockets,
SysUtils,
mormot.core.log,
mormot.net.ws.core,
mormot.core.text,
Classes,
SharedInterface,
ServerUnit;
var
Server: TServer;
HeaptraceFile: String;
begin
{$IF DECLARED(heaptrc)}
HeaptraceFile := ExtractFileDir(ParamStr(0)) + PathDelim + 'heaptrace.log';
if FileExists(HeaptraceFile) then DeleteFile(HeaptraceFile);
SetHeapTraceOutput(HeaptraceFile);
{$ENDIF}
with TSynLog.Family do begin // enable logging to file and to console
Level := LOG_VERBOSE;
EchoToConsole := LOG_VERBOSE;
PerThreadLog := ptIdentifiedInOnFile;
end;
WebSocketLog := TSynLog; // verbose log of all WebSockets activity
try
Server := TServer.Create;
try
Server.Run;
finally
Server.Free;
end;
except
on E: Exception do
ConsoleShowFatalException(E);
end;
end.