2022-04-01 12:51:01 +00:00
|
|
|
---@diagnostic disable: lowercase-global
|
|
|
|
inspect = require "inspect"
|
|
|
|
|
|
|
|
DebugMode = true
|
|
|
|
function PrintWhenMethodCall()
|
2022-04-30 07:27:56 +00:00
|
|
|
local info = debug.getinfo(2)
|
|
|
|
local name = info.name
|
|
|
|
local line = info.currentline
|
|
|
|
local namewhat = info.namewhat
|
|
|
|
local shortsrc = info.short_src
|
|
|
|
if (namewhat == "method") and
|
|
|
|
(shortsrc ~= "[C]") and
|
|
|
|
(not string.find(shortsrc, "/lib")) then
|
|
|
|
print(shortsrc .. ":" .. line .. ": " .. name)
|
|
|
|
end
|
2022-04-01 12:51:01 +00:00
|
|
|
end
|
|
|
|
--debug.sethook(PrintWhenMethodCall, "c")
|
|
|
|
|
|
|
|
function p(v) print(inspect(v)) end
|
2022-04-14 10:22:00 +00:00
|
|
|
function pt(t) for k,v in pairs(t)do print(k,v) end end
|