forked from ivanpirog/vortextracker
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLogger.pas
More file actions
43 lines (33 loc) · 668 Bytes
/
Logger.pas
File metadata and controls
43 lines (33 loc) · 668 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
{
This is part of Vortex Tracker II project
Version 2.0 and later
(c)2017-2021 Ivan Pirog, ivan.pirog@gmail.com
https://github.com/ivanpirog/vortextracker
}
unit Logger;
interface
type
TLogger = class
Opened: Boolean;
LogFile: TextFile;
constructor Create(FileName: String);
destructor Destruct;
procedure Add(Str: String);
end;
implementation
constructor TLogger.Create(FileName: String);
begin
if Opened then Exit;
AssignFile(LogFile, FileName);
Rewrite(LogFile);
Opened := True;
end;
destructor TLogger.Destruct;
begin
CloseFile(LogFile);
end;
procedure TLogger.Add(Str: String);
begin
Writeln(LogFile, Str);
end;
end.