The script editor includes two different built-in log views:
Script error - Displays runtime errors from the script, such as invalid function arguments, out-of-range values, or syntax problems. When a script fails, the error message and line number appear here.
Script log - Displays output from print() calls in your script. Use this for debugging values, tracing logic flow, and verifying CAN data.

Built-in Lua script logger in MTune.

Lua code:
-- This appears in the "Script log" window
print("RPM: " .. ecu.getf(RTDATA.RPM))

Lua code:
-- This appears in the "Script error" window
io.din(99, true) -- error: DIN nr 99 out of range [1..12]
For more information about the MaxxECU user scripts, see User Scripts (LUA), or directly reference the LUA api reference and LUA examples. For more all available LUA settings and options, see Script Code, Script Input Control, Output Functions and Script RT values.