I have a project that was written in Delphi 6 and used Indy 8. I need to upgrade this project to Delphi 2005 and use Indy 10.
In Delphi 2005, when I open the Form containing the old Indy components, the following two errors occur:
Property OnLogItem does not exist
Property Target does not exist
Both of these errors have to do with Indy’s TIdLogDebug component.
I have heard that instead of using the TIdLogDebug, one must use TIdLogEvent instead. However, this component does not have the OnLogItem and Target properties.
What event handler should I use with the TIdLogEvent component of Indy 10, that substitutes the OnLogItem event of the TIdLogDebug component of Indy 8?
TIdLogDebugitself still exists in Indy 10, but it is very different than Indy 8’sTIdLogDebug.TIdLogDebugin Indy 9 and later does not have aTargetproperty or anOnLogItemevent anymore.Indy 8’s
TIdLogDebugwas Indy’s only logging component and it supported multiple types of output – file, debugger, and event. In Indy 9, that functionality was split into separateTIdLogFile,TIdLogDebug, andTIdLogEventcomponents (and a newTIdLogStreamcomponent was added).In Indy 9 and later, the
TIdLogEventcomponent would be the correct replacement to use.TIdLogEventhasOnReceived,OnSent, andOnStatusevents. Indy 8 did not differentiate between different directions of data flow inTIdLogDebug, everything was funneled through the singleOnLogItemevent. The log messages for each direction of data flow had different prefixes. In Indy 9 and later, separate events are now used for each direction, so there is no direct replacement for the oldOnLogItemevent. You need to update your code to fit in with the newer event model.