Changeset 393 for trunk/Library


Ignore:
Timestamp:
May 1, 2016, 10:02:47 AM (9 years ago)
Author:
RBRi
Message:

add LogMem aspect (merged from old 2.20)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Library/DebugUnit.pas

    r388 r393  
    22
    33// NewView - a new OS/2 Help Viewer
    4 // Copyright 2006/2007 Ronald Brill (rbri at rbri dot de)
     4// Copyright 2006-2009 Ronald Brill (rbri at rbri dot de)
    55// This software is released under the GNU Public License - see readme.txt
    66
     
    2929                        LogViewStub,
    3030                        LogObjConstDest,
    31                         LogMem,
    3231                        LogDebug
    3332    );
    3433    LogAspects = SET OF LogAspect;
    3534
    36   Function IsLogAspectsEnabled(const aLogAspect: LogAspect) : boolean;
    3735  Procedure LogEvent(const aLogAspect: LogAspect; const anEventDescription: String);
    3836
     
    5149
    5250  Procedure SetLogAspects(const aCommaSeparatedListOfAspectNames : String);
     51
     52  Procedure writeDebugSetupDetailsTo(aStrings : TStrings);
    5353
    5454
     
    5959  PMPrintfString : Function(aString : PChar) : ULONG; APIENTRY;
    6060  activeLogAspects : LogAspects;
     61  infoMessage1 : String;
     62  infoMessage2 : String;
    6163
    6264
     
    6769  BseDos,
    6870  StringUtilsUnit;
     71
     72  Procedure writeDebugSetupDetailsTo(aStrings : TStrings);
     73  begin
     74    aStrings.Add('---- Debug ----');
     75    aStrings.Add('  ' + infoMessage1);
     76    aStrings.Add('  ' + infoMessage2);
     77  end;
     78
    6979
    7080  FUNCTION LoadPMPrinfFLib : integer;
     
    8191    tmpDllName:='PMPRINTF';
    8292    tmpRC := DosLoadModule(tmpErrorInfo, 255, tmpDllName, PMPrintfModuleHandle);
     93    infoMessage1 := 'DosLoadModule ' + tmpDllName + ' rc: ' + IntToStr(tmpRC);
    8394    if tmpRC <> 0 then
    8495    begin
     
    90101    tmpProcedureName := 'PmPrintfString';
    91102    tmpRC := DosQueryProcAddr(PMPrintfModuleHandle, 0, tmpProcedureName, tmpProcedureAddress);
     103    infoMessage2 := 'DosQueryProcAddr ' + tmpProcedureName + ' rc: ' + IntToStr(tmpRC);
    92104    if tmpRC <> 0 then
    93105    begin
     
    132144      LogViewStub     : result := 'ViewStub';
    133145      LogObjConstDest : result := 'ObjConstDest';
    134       LogMem          : result := 'Mem';
    135146      LogDebug        : result := 'Debug';
    136147      else              result := 'Unknown';
     
    159170      if tmpAspects[i] = 'LogViewStub'     then activeLogAspects := activeLogAspects + [ LogViewStub ];
    160171      if tmpAspects[i] = 'LogObjConstDest' then activeLogAspects := activeLogAspects + [ LogObjConstDest ];
    161       if tmpAspects[i] = 'LogMem'          then activeLogAspects := activeLogAspects + [ LogMem ];
    162172      if tmpAspects[i] = 'LogDebug'        then activeLogAspects := activeLogAspects + [ LogDebug ];
    163173    end;
     
    167177
    168178
    169   Function IsLogAspectsEnabled(const aLogAspect: LogAspect) : boolean;
    170   Begin
    171     result := aLogAspect IN activeLogAspects;
    172   End;
    173 
    174 
    175179  Procedure LogEvent(const aLogAspect: LogAspect; const anEventDescription: String);
    176180  Var
    177181    tmpMessage : String;
    178182  Begin
    179     if IsLogAspectsEnabled(aLogAspect) then
     183    if (aLogAspect IN activeLogAspects) then
    180184    begin
    181185      tmpMessage := 'Log[' + GetAspectPrefix(aLogAspect) + ']  ' + anEventDescription;
Note: See TracChangeset for help on using the changeset viewer.