Writing Messages in a Log (WriteToLOG)

Use the WriteToLOG method to write a message directly to the connection log saved in the path set in CuteFTP Professional's global options. It is useful for documenting events to aid in script debugging.

Syntax

Object.WriteToLOG(BSTR bstr , BSTR bstrType)

Parameters

bstr

The log message.

bstrType

A log message, type: "STATUS", "ERROR", "NOTE", "COMMAND", "RAW". The default is "STATUS".

Example

Set MySite = CreateObject("CuteFTPPro.TEConnection")

'Initialize all necessary fields for MySite : host name, user, password, etc.

MySite.TransferURLAsync "ftp://ftp.cuteftp.com/pub/cuteftp"

strResult = MySite.Wait

If (strResult = "FINISHED") then

MySite.WriteToLOG "Transfer successful!!"

MySite.WriteToLOG "Transfer successful!!", "error"

MySite.WriteToLOG "Transfer successful!!", "note"

End if

As result, the log will contain the following strings:

STATUS: > Transfer successful!!

ERROR: > Transfer successful!!

Note > Transfer successful!!