3 {$INCLUDE ../shared/a_modes.inc}
11 TWriteMode
=(WM_NEWFILE
, WM_OLDFILE
);
12 TRecordCategory
=(MSG_FATALERROR
, MSG_WARNING
, MSG_NOTIFY
);
14 procedure e_InitLog(fFileName
: String; fWriteMode
: TWriteMode
);
15 procedure e_WriteLog(TextLine
: String; RecordCategory
: TRecordCategory
;
16 WriteTime
: Boolean = True);
17 function DecodeIPV4(ip
: LongWord): string;
27 function DecodeIPV4(ip
: LongWord): string;
29 Result
:= Format('%d.%d.%d.%d', [ip
and $FF, (ip
shr 8) and $FF, (ip
shr 16) and $FF, (ip
shr 24)]);
32 procedure e_WriteLog(TextLine
: String; RecordCategory
: TRecordCategory
;
33 WriteTime
: Boolean = True);
38 if FileName
= '' then Exit
;
40 Assign(LogFile
, FileName
);
41 if FileExists(FileName
) then
47 Writeln(LogFile
, '--- Log started at '+TimeToStr(Time
)+' ---');
50 case RecordCategory
of
51 MSG_FATALERROR
: Prefix
:= '!!!';
52 MSG_WARNING
: Prefix
:= '! ';
53 MSG_NOTIFY
: Prefix
:= '***';
56 Writeln(LogFile
, '['+TimeToStr(Time
)+'] '+Prefix
+' '+TextLine
)
58 Writeln(LogFile
, Prefix
+' '+TextLine
);
62 procedure e_InitLog(fFileName
: String; fWriteMode
: TWriteMode
);
64 FileName
:= fFileName
;
65 if fWriteMode
= WM_NEWFILE
then
66 if FileExists(FileName
) then