Skip to content

setLogSilent

Determines if debugging functions such as ac.log(), ac.warn(), and ac.error() should write their output to the physical log file on your drive.

Calling the function without an argument or with true stops disk writing.

ac.setLogSilent(true)

The ac.setLogSilent function is a performance and hardware safety utility. Writing to a physical file on an SSD or HDD is a relatively slow operation compared to updating a UI element. When you are debugging complex logic that prints multiple messages every frame, the overhead of disk I/O has potential to cause noticeable stuttering or “lag” in the simulation.

By silencing the log, you can continue to use high-frequency logging for development while ensuring the simulation remains smooth. This also helps prevent unnecessary wear on storage hardware during long development sessions.

ParameterTypeRequiredDefaultDescription
valuebooleanNotrueWhether logging to the disk should be silenced.

Silencing the log to safely monitor a variable that changes every frame.

-- stop writing to the physical file to save performance
ac.setLogSilent(true)
function script.update()
local car = ac.getCar(0)
-- this would normally spam the drive, but is now safe
ac.log("Current Speed:", car.speedKmh)
end