GetCallStackByLevels function

Top  Previous  Next

EurekaLog includes a function called GetCallStackByLevels, that enables you to obtain only a custom subset of the current call-stack. You can choose what levels obtains (the level=0 indicate the current running routine, the level=1 the caller of the current routine, ...).

 

Syntax of this function is as follows:

 

function GetCallStackByLevels(StartLevel, LevelsNumber: Integer): TEurekaStackList;

 

 

Example:

 

 

uses ExceptionLog; // The required unit...

 

var

   CallStackList: TStringList;

   CallStack: TEurekaStackList;

begin

   CallStackList := TStringList.Create;

   try

     CallStack := GetCallStackByLevels(099);

     try

       CallStackToStrings(CallStack, CallStackList);

       // ...

       // Use the CallStackList here...

       // ...

     finally

       CallStack.Free;

     end;

   finally;

     CallStackList.Free;

   end;

end;