log
The primary debugging tool for monitoring script behavior and identifying errors in real-time.
Usage Patterns
Section titled “Usage Patterns”The explicit namespace call. Recommended for clarity in larger projects.
ac.log("Script initialized")For convenience, the standard Lua print() is globally aliased to ac.log().
print("Application started")Description
Section titled “Description”ac.log outputs text to both the physical log file on your drive and the in-game Lua Debug app’s console.
It accepts a variable number of arguments and automatically joins them with spaces.
Primitive values and CSP-specific types such as vec3, rgb, and rgbm are converted into readable string representations.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
... | any | Yes | One or more values to be stringified and logged. |
Examples
Section titled “Examples”Passing multiple mixed-type variables to track state.
local gear = 4local speed = 120.5
ac.log("Vehicle Status:", "Gear", gear, "Speed", speed)-- output: Vehicle Status: Gear 4 Speed 120.5Debugging vector positions and colors without manual conversion.
local pos = vec3(10, 0, 50)local tint = rgbm(1, 0, 0, 0.5)
ac.log("Checking coordinates...")ac.log(pos)ac.log(tint)