-
Notifications
You must be signed in to change notification settings - Fork 10
Example_SimplestLog
Juan Antonio Castillo edited this page Mar 8, 2022
·
3 revisions
This is an example on how easy is to to start adding log entries to your program
uses
ujachLogMgr, ujachLogAuto;
{$R *.dfm}
procedure TmyForm.ProcessData(InputFileName: string);
var
I: Integer;
begin
jachLog.LogInfo('Data processing start, FileName: %s', [InputFileName]);
try
jachLog.LogInfo('Opening file...');
OpenDataFile(InputFileName);
jachLog.LogInfo('Processing %d records on file...', [FDataFile.RecordCount]);
for I := 0 to FDataFile.RecordCount - 1 do
ProcessDataRecord(I);
jachLog.LogInfo('Closing file...');
CloseDataFile();
jachLog.LogInfo('Sending notifications...');
SendNotifications;
jachLog.LogInfo('Data processing finished succesfully');
except
on E:Exception do
begin
jachLog.LogError('Data processing finished with Error', E);
raise;
end;
end;
end;
jump to: get started — multiple log destinations — units and classes — wiki home — blog (English) — blog (Spanish) — library home