Root > Reference > All Functions > ELogEnter

Function ELogEnter

Previous pageReturn to chapter overviewNext page   

Creates a new log entry about entering method/function/procedure.

 

Unit

ELogging

 

Syntax

 

Code (Delphi)

function ELogEnter(

const AFuncName: String = ''

): IEurekaLoggerParams; overload;

 

function ELogEnter(

const ASelf: TObject;

const AMethodName: String = ''

): IEurekaLoggerParams; overload;

 

function ELogEnter(

const ASelf: TClass;

const AMethodName: String = ''

): IEurekaLoggerParams; overload;

 

Parameters

AFuncName

Name of the logged function or procedure.

 

ASelf

Object or class which method is called.

 

AMethodName

Name of the logged method. Must belong to ASelf.

 

Return value

Returns created log entry.

 

Remarks

Use this function to add entries to log when entering sub-routine. The call to this function must be the first call in the sub-routine.

 

EurekaLog will log exit from sub-routine automatically. However, if you want to manually log early exit or specify a result - use Ret method.

 

You may alter created log entry (for example, change category, color, etc.) via methods of IEurekaLogger interface.

 

Important!

You have to call either D or C method on the returned IEurekaLoggerParams interface. Otherwise nested log entries may have wrong identation in the resulting log file.

 

Examples

 

Code (Delphi)

procedure DoSomething;

begin

ELogEnter('DoSomething').D;

 

// your code

end;

 

Code (Delphi)

procedure TObject.DoSomething;

begin

ELogEnter(Self, 'DoSomething').D;

 

// your code

end;

 

Code (Delphi)

procedure TObject.DoSomething(const AValue: Integer);

begin

ELogEnter(Self, 'DoSomething').P('AValue', AValue).D;

 

// your code

end;

 

Code (Delphi)

procedure TObject.DoSomething(const AMsg: String; const AValue: Integer);

begin

ELogEnter(Self, 'DoSomething').P('AMsg', AMsg).P('AValue', AValue).D;

 

// your code

end;

 

Code (Delphi)

function TObject.DoSomething(const AValue: Integer): Integer;

var

L: IEurekaLoggerParams;

begin

L := ELogEnter(Self, 'DoSomething').P('AValue', AValue).D;

 

// your code

 

L.Ret(Result);

end;

 

See also




Send feedback... Build date: 2018-11-26
Last edited: 2018-11-26
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_elogging_elogenter.php