System.Log

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

System.Log(level As Integer, msg As String)

Supported on Desktop, Web, Console.

Writes msg to the logging mechanism.

Notes

On macOS and Linux, it writes to the system logger, which is typically at /var/log. On Windows it writes to the Event Logger, which can be viewed by the Event Viewer.

fa-info-circle-32.png
Log is not supported for Mobile projects.
fa-info-circle-32.png
On macOS, the following levels do not appear in the log: debug, information, and success. This is an macOS issue.

For debugging purposes, use System.DebugLog instead.

Use the following class constants when setting the value of the Level parameter in calls to the Log method.

Level class constants
System.LogLevelAlert
System.LogLevelCritical
System.LogLevelDebug
System.LogLevelEmergency
System.LogLevelError
System.LogLevelInformation
System.LogLevelNotice
System.LogLevelSuccess
System.LogLevelWarning

Example

For the following example writes your error message with the LogLevelError constant.

System.Log(System.LogLevelError, "my Error message")

See Also

System.DebugLog