Skip to main content
Version: Next

logEvent

logEvent ( message {; importance} )

ParameterTypeDescription
messageTextContents of the message
importanceIntegerMessage’s importance level

Description

The logEvent command writes message in the diagnostic log file in response to events that occur during the use of your application.

info

You can access the diagnostic log file in the Logs tab of the Console.

Pass in message the custom information to be written in the diagnostic log file according to the event.

You can attribute a level of importance to message, via the optional importance parameter which helps you to read and understand the log events. There are three levels of importance: Information (default), Warning, and Error. You can use the following constants:

ConstantValue
kInformationMessage0
kWarningMessage1
kErrorMessage2

If you don't pass the importance parameter or pass an invalid value, the default value (0) is used.

Example

You want to log each user search string that did not match anything on your application:


if(searchResult == false)
logEvent("Unsuccessful search: "+searchString)
end