Using the ITLogLib API

Until iTech Logging version 2.2 the COM variant of ITLogLib, ITLogLib/COM, was the only way to use iTech Logging from Delphi. The interface of the newer ITLogLib/Delphi is similar that of ITLogLib/COM. More generally, it is also similar to the interfaces of the other ITLogLib variants, but each variant has some specialities due to technical and language style reasons.

 

Because the API of ITLogLib/Delphi was made maximally compatible to the API ITLogLib/COM, please refer to the online help of ITLogLib/COM to learn more about this API. You can also look at the interface part of the source code file for the ITLogLib/Delphi unit, the file "ITLogLib2.pas".

 

The following table lists the major API differences between ITLogLib/COM and ITLogLib/Delphi:

 

 

ITLogLib/COM

ITLogLib/Delphi

Destruction of the ITLogLib instance

(you can also use more than one, if you prefer)

automatically

 

Delphi frees ITLogLib instances automatically at the end of their scope, thanks to the COM support of Delphi.

user-managed

 

As with all native Delphi objects, you have to release ITLogLib instances yourself, by calling their Free method.

Destruction of ITOutputLogChannel instances

automatically (as above)

library-managed

 

ITOutputLogChannel instances are managed by the logging library.

 

Caution: Do not use Free or Destroy for such instances! Alas it is not possible for us to effectively remove or hide Free and Destroy from the public interface.

Destruction of ITLogMsg instances

automatically (as above)

user-managed

 

As with all native Delphi objects, you have to release ITLogMsg instances yourself, by calling their Free method.

Name of the method for ITLogMsg instance reuse

 

(ITLogMsg instances can be (re)used to output multiple logmessages in their life-time.)

Create()

Recreate()

 

We didn't use the name "Create" in the Delphi API as it normally designates constructors in Delphi.

Class ITLogMsg is a normal class which provides constructors and we named them "Create" as usual.

Support of default parameters

(affected methods:

·      global: QuickLog

·      ITOutputLogChannel: CreateLogMsg, QuickLog,

·      ITLogMsg: Create, Recreate, AddParam

)

no

 

Note: The COM DLL itself has methods with default parameters, but the wrapper generated by Delphi to use it from Delphi ignores this and makes these parameters mandatory.

yes

Support of overloading (affected methods:

a)    where used to allow different types:

·      ITLogMsg: Add, AddParam

b)    where used for more technical reasons:

·      ITLogLib: RunApplication

·      ITLogMsg: Create, Recreate

)

no

The COM DLL usually supports here only string as parameter type.

 

 

 

 


COM does not support parameterized constructors.

yes