Changeset 393 for trunk/Library
- Timestamp:
- May 1, 2016, 10:02:47 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Library/DebugUnit.pas
r388 r393 2 2 3 3 // NewView - a new OS/2 Help Viewer 4 // Copyright 2006 /2007Ronald Brill (rbri at rbri dot de)4 // Copyright 2006-2009 Ronald Brill (rbri at rbri dot de) 5 5 // This software is released under the GNU Public License - see readme.txt 6 6 … … 29 29 LogViewStub, 30 30 LogObjConstDest, 31 LogMem,32 31 LogDebug 33 32 ); 34 33 LogAspects = SET OF LogAspect; 35 34 36 Function IsLogAspectsEnabled(const aLogAspect: LogAspect) : boolean;37 35 Procedure LogEvent(const aLogAspect: LogAspect; const anEventDescription: String); 38 36 … … 51 49 52 50 Procedure SetLogAspects(const aCommaSeparatedListOfAspectNames : String); 51 52 Procedure writeDebugSetupDetailsTo(aStrings : TStrings); 53 53 54 54 … … 59 59 PMPrintfString : Function(aString : PChar) : ULONG; APIENTRY; 60 60 activeLogAspects : LogAspects; 61 infoMessage1 : String; 62 infoMessage2 : String; 61 63 62 64 … … 67 69 BseDos, 68 70 StringUtilsUnit; 71 72 Procedure writeDebugSetupDetailsTo(aStrings : TStrings); 73 begin 74 aStrings.Add('---- Debug ----'); 75 aStrings.Add(' ' + infoMessage1); 76 aStrings.Add(' ' + infoMessage2); 77 end; 78 69 79 70 80 FUNCTION LoadPMPrinfFLib : integer; … … 81 91 tmpDllName:='PMPRINTF'; 82 92 tmpRC := DosLoadModule(tmpErrorInfo, 255, tmpDllName, PMPrintfModuleHandle); 93 infoMessage1 := 'DosLoadModule ' + tmpDllName + ' rc: ' + IntToStr(tmpRC); 83 94 if tmpRC <> 0 then 84 95 begin … … 90 101 tmpProcedureName := 'PmPrintfString'; 91 102 tmpRC := DosQueryProcAddr(PMPrintfModuleHandle, 0, tmpProcedureName, tmpProcedureAddress); 103 infoMessage2 := 'DosQueryProcAddr ' + tmpProcedureName + ' rc: ' + IntToStr(tmpRC); 92 104 if tmpRC <> 0 then 93 105 begin … … 132 144 LogViewStub : result := 'ViewStub'; 133 145 LogObjConstDest : result := 'ObjConstDest'; 134 LogMem : result := 'Mem';135 146 LogDebug : result := 'Debug'; 136 147 else result := 'Unknown'; … … 159 170 if tmpAspects[i] = 'LogViewStub' then activeLogAspects := activeLogAspects + [ LogViewStub ]; 160 171 if tmpAspects[i] = 'LogObjConstDest' then activeLogAspects := activeLogAspects + [ LogObjConstDest ]; 161 if tmpAspects[i] = 'LogMem' then activeLogAspects := activeLogAspects + [ LogMem ];162 172 if tmpAspects[i] = 'LogDebug' then activeLogAspects := activeLogAspects + [ LogDebug ]; 163 173 end; … … 167 177 168 178 169 Function IsLogAspectsEnabled(const aLogAspect: LogAspect) : boolean;170 Begin171 result := aLogAspect IN activeLogAspects;172 End;173 174 175 179 Procedure LogEvent(const aLogAspect: LogAspect; const anEventDescription: String); 176 180 Var 177 181 tmpMessage : String; 178 182 Begin 179 if IsLogAspectsEnabled(aLogAspect) then183 if (aLogAspect IN activeLogAspects) then 180 184 begin 181 185 tmpMessage := 'Log[' + GetAspectPrefix(aLogAspect) + '] ' + anEventDescription;
Note:
See TracChangeset
for help on using the changeset viewer.