LogText Method for LCSession
This method adds a new external entry to the log for this activity.
This Log method logs an external basic error or event; use LogTextEx for external extended logs and Log or LogEx for HCL Enterprise Integrator (HEI) errors. When logging an error, the activity status is set, placing the activity into an error state. A message is composed from the external text and code, and is added to any Log entry for this activity. Use the method to log external errors from data providers when HEI does not have the error message available. Obtain the error code and text for an external error message, and call LogText to add that information to the HEI log. The HEI error code used for this type of error is LCFAIL_EXTERNAL, which is the same value returned by the method for error logs.
Defined In
LCSession Class
Syntax
Call lcSession. LogText (logFlags, text, externalCode)
Parameters
Parameter |
Description |
---|---|
logFlags |
Long. Flags which affect this log entry. Zero or more of the following values are ORed together: LCLOGSTREAMF_EVENT Log a non-error event. |
text |
String. External log text. |
externalCode |
Long. External logcode. Use zero if you have no particular code to report. |
Example
Create an HEI Scripted activity that runs the script as follows. LCStream text is written to the Scripted activity log.
Option Public
Uselsx "*lsxlc"
Sub Initialize
'create the New LCSession and New LCStream Objects
Dim myTestLog As New LCSession ("LogTest")
Dim myTextString As New LCStream
Dim x As Integer
Dim y As Integer
Dim z As Integer
myTextString.text = "HEI 3.2 Script Example Using LCStream"
x=1 ' For loop start value
y=1 ' Counter start value
z=10 ' For loop end value
'write entries to the Scripted activity log
For x% = 1 To z
Call myTestLog.Logtext (LCLOGSTREAMF_EVENT, myTextString.text & " -- Log Entry_"&Cstr(y), 0)
y=y+1
Next
End Sub