Console
Quick Reference
| Name | Type | Description |
|---|---|---|
| Log | Shared | Prints a message to the console and the log file. |
Shared Functions
Log
Prints a message to the console and the log file.
Console.Log(string message)
JavaScript
console.log(...) works as well and takes any number of arguments of any type; objects are printed
as JSON. console.warn and console.error write to the log at the matching level.
Example:
- Lua
- JavaScript
- Squirrel (deprecated)
Events.Subscribe("playerDisconnect", function(id, name, reason)
Console.Log("Player " .. name .. " has left the server with reason " .. reason .. ".")
end)
Events.Subscribe("playerDisconnect", (id, name, reason) => {
Console.Log("Player " + name + " has left the server with reason " + reason + ".");
});
Events.Subscribe("playerDisconnect", function(id, name, reason) {
Console.Log("Player " + name + " has left the server with reason " + reason + ".");
});