Changeset 40 for ExceptionLogger/UExceptionLogger.pas
- Timestamp:
- Sep 9, 2010, 1:58:30 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ExceptionLogger/UExceptionLogger.pas
r39 r40 21 21 StackTrace: TStackTrace; 22 22 LastException: Exception; 23 IgnoreList: TStringList; 23 24 constructor Create(AOwner: TComponent); override; 24 25 destructor Destroy; override; … … 54 55 end; 55 56 56 57 57 { TExceptionLogger } 58 58 … … 60 60 begin 61 61 inherited Create(AOwner); 62 IgnoreList := TStringList.Create; 62 63 StackTrace := TStackTrace.Create; 63 64 MaxCallStackDepth := 20; … … 69 70 begin 70 71 StackTrace.Free; 72 IgnoreList.Free; 71 73 inherited Destroy; 72 74 end; … … 155 157 Report: TStringList; 156 158 begin 157 Report := TStringList.Create; 158 try 159 CreateTextReport(Report); 160 if FLogFileName <> '' then begin 161 LogToFile(Report); 162 LogStackTraceToFile(StackTrace); 159 if IgnoreList.IndexOf(LastException.ClassName) = -1 then begin 160 Report := TStringList.Create; 161 try 162 CreateTextReport(Report); 163 if FLogFileName <> '' then begin 164 LogToFile(Report); 165 LogStackTraceToFile(StackTrace); 166 end; 167 ExceptionForm.MemoExceptionInfo.Lines.Assign(Report); 168 ShowReportForm; 169 finally 170 Report.Free; 163 171 end; 164 ExceptionForm.MemoExceptionInfo.Lines.Assign(Report); 165 ShowReportForm; 166 finally 167 Report.Free; 172 if ExceptionForm.CheckBoxIgnore.Checked then 173 IgnoreList.Add(LastException.ClassName); 168 174 end; 169 175 end;
Note:
See TracChangeset
for help on using the changeset viewer.