The HotSync Log
The CDK provides routines that add to a HotSync log. There are several useful routines, but the main one to use is LogAddEntry.
LogAddEntry
Use this routine to add entries to the HotSync all the time.
LogAddEntry(logString, activity, timestamp)
-
timestamp This is a boolean. True means that the log entry will be timestamped.
-
activity This is an enumerated type. There are many different enumeration constants available for your use.
The enumerated types used most often as a value for
activity are:
- slSyncStarted
Tells the log that your conduit is beginning synchronization. Call the following when you begin the sync process:
LogAddEntry("", slSyncStarted, false- slSyncAborted
Tells the log that your conduit is done and that there was an error. Call:
LogAddEntry (your conduit name, slSyncAborted, falsewhen you finish syncing with an error.
- slSyncFinished
Tells the log that your conduit is done without errors. Call:
LogAddEntry(your conduit name, slSyncFinished, false)when you finish syncing without an error.
- slWarning
Adds the specified
logStringto the log and tells the user at the end of the HotSync that there are messages in the log.slText
Adds the specified
logStringto the log, but doesn’t tell the user about the message.
LogAddFormattedEntry
Another useful routine is LogAddFormattedEntry.
It acts as a combination of sprintf and
LogAddEntry and helps if you need to construct
the log string from numbers or other strings. Here’s an example
of its use:
LogAddFormattedEntry(slText, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access