Added: Category is now added to log files
This commit is contained in:
parent
c5bb17cb86
commit
d7b18972c3
@ -21,14 +21,32 @@ resourcestring
|
||||
X2Log.Observer.LogFile
|
||||
}
|
||||
|
||||
{ The format of the log line without a category
|
||||
|
||||
0: Message
|
||||
}
|
||||
LogFileLineNoCategory = '%0:s';
|
||||
|
||||
{ The format of the log line with a category
|
||||
|
||||
0: Message
|
||||
1: Category
|
||||
}
|
||||
LogFileLineCategory = '%1:s: %0:s';
|
||||
|
||||
|
||||
{ Date format used to determine the file name of detail files }
|
||||
LogFileNameDateFormat = 'yyyymmdd_hhnn';
|
||||
|
||||
{ Date format used in log files }
|
||||
LogFileLineDateFormat = 'yyyy-mm-dd hh:nn';
|
||||
|
||||
{ The text added to the message if details are stored externally }
|
||||
LogFileLineDetails = ' (details: %s)';
|
||||
{ The format of the log message when details are stored externally
|
||||
|
||||
0: Message
|
||||
1: Details filename
|
||||
}
|
||||
LogFileLineDetails = '%0:s (details: %1:s)';
|
||||
|
||||
|
||||
{
|
||||
|
@ -117,7 +117,11 @@ var
|
||||
|
||||
begin
|
||||
ForceDirectories(ExtractFilePath(FileName));
|
||||
errorMsg := AEntry.Message;
|
||||
|
||||
if Length(AEntry.Category) > 0 then
|
||||
errorMsg := Format(GetLogResourceString(@LogFileLineCategory), [AEntry.Message, AEntry.Category])
|
||||
else
|
||||
errorMsg := Format(GetLogResourceString(@LogFileLineNoCategory), [AEntry.Message]);
|
||||
|
||||
if Supports(AEntry.Details, IX2LogDetailsStreamable, logDetailsStreamable) then
|
||||
begin
|
||||
@ -160,7 +164,7 @@ begin
|
||||
|
||||
// ErrorLogs.Add(reportFileName);
|
||||
|
||||
errorMsg := errorMsg + Format(GetLogResourceString(@LogFileLineDetails), [ExtractFileName(detailsFileName)]);
|
||||
errorMsg := Format(GetLogResourceString(@LogFileLineDetails), [errorMsg, ExtractFileName(detailsFileName)]);
|
||||
break;
|
||||
end;
|
||||
until False;
|
||||
|
Loading…
Reference in New Issue
Block a user