🐦⬛Debugging
A few days ago I came across something that was useful to me and I will share it with you. The official post of this thing is by jaysixty from the official QBCORE group because this worked very well
super simple, but all you need to do is put Debug(), rather than the usual print("1"), print("2"), print("hello") etc
-- Add this to top of the file
local Debug = function()
print("LINE:", debug.getinfo(2).currentline)
end
-- Add this where ever you need the print
Debug() -- in this case, print would be 7Because I use this whole thing and I modified it a bit so that it also says which file to search in and its message. Whoever wants to use it.
local Debug = function(...)
if Config.DebugHelper then
local info = debug.getinfo(2, "Sl")
local side = IsDuplicityVersion() and "Server side" or "Client side"
local debugMsg = string.format("[%s] FILE: %s LINE: %d", side, info.short_src, info.currentline)
print(debugMsg, ...)
end
end
-- Add this where ever you need the print
Debug() -- in this case, print would be 7Last updated