Debug

Debug Helper

  • Prints one or multiple objects into CET Console

  • Prints one or multiple objects into Individual Mod Logs file

  • Handle table with indentation

  • Handle boolean, nil, string and other classic types

  • Parse userdata via GameDump() or Dump() if possible

  • Parse CName via NameToString() if possible

Definitions

Prints to CET Console, similar to print() function.

debug.print(obj: object [, obj2, ...]) -> nil

Write in Individual Mod Logs file. eg, <cet_path>/mods/my_mod/my_mod.log. Similar to spdlog.

debug.log(obj: object [, obj2, ...]) -> nil

Usage example

init.lua
local myTable = {
    var = true,
    enabled = false,
    subTable = {
        player = Game.GetPlayer(),
        stats = Game.GetStatsSystem()
    }
}

debug.log('myTable:', myTable)

Source code

Last updated