logEvent
logEvent ( message {; importance} )
Parameter | Type | Description | |
---|---|---|---|
message | Text | → | Contents of the message |
importance | Integer | → | Message’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.
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:
Constant | Value |
---|---|
kInformationMessage | 0 |
kWarningMessage | 1 |
kErrorMessage | 2 |
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