System.Log

From Xojo Documentation

Revision as of 21:08, 9 December 2020 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
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