9 TWriteMode
=(WM_NEWFILE
, WM_OLDFILE
);
10 TRecordCategory
=(MSG_FATALERROR
, MSG_WARNING
, MSG_NOTIFY
);
12 procedure e_InitLog(fFileName
: String; fWriteMode
: TWriteMode
);
13 procedure e_WriteLog(TextLine
: String; RecordCategory
: TRecordCategory
;
14 WriteTime
: Boolean = True);
15 function DecodeIPV4(ip
: LongWord): string;
25 function DecodeIPV4(ip
: LongWord): string;
27 Result
:= Format('%d.%d.%d.%d', [ip
and $FF, (ip
shr 8) and $FF, (ip
shr 16) and $FF, (ip
shr 24)]);
30 procedure e_WriteLog(TextLine
: String; RecordCategory
: TRecordCategory
;
31 WriteTime
: Boolean = True);
36 if FileName
= '' then Exit
;
38 Assign(LogFile
, FileName
);
39 if FileExists(FileName
) then
45 Writeln(LogFile
, '--- Log started at '+TimeToStr(Time
)+' ---');
48 case RecordCategory
of
49 MSG_FATALERROR
: Prefix
:= '!!!';
50 MSG_WARNING
: Prefix
:= '! ';
51 MSG_NOTIFY
: Prefix
:= '***';
54 Writeln(LogFile
, '['+TimeToStr(Time
)+'] '+Prefix
+' '+TextLine
)
56 Writeln(LogFile
, Prefix
+' '+TextLine
);
60 procedure e_InitLog(fFileName
: String; fWriteMode
: TWriteMode
);
62 FileName
:= fFileName
;
63 if fWriteMode
= WM_NEWFILE
then
64 if FileExists(FileName
) then