-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlogger.pas
More file actions
49 lines (37 loc) · 712 Bytes
/
logger.pas
File metadata and controls
49 lines (37 loc) · 712 Bytes
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
unit logger;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, eventlog;
procedure LogInfo(const msg: string);
procedure LogWarning(const msg: string);
procedure LogError(const msg: string);
implementation
var
log: TEventLog;
procedure SetupLog;
begin
log:=TEventLog.Create(Nil);
log.LogType:=ltFile;
log.FileName:='Supervisor.log';
log.AppendContent:=True;
log.Active:=True;
log.Info('Supervisor starting...');
end;
procedure LogInfo(const msg: string);
begin
log.Info(msg);
end;
procedure LogWarning(const msg: string);
begin
log.Warning(msg);
end;
procedure LogError(const msg: string);
begin
log.Error(msg);
end;
initialization
SetupLog;
finalization
log.Free;
end.