Simple Debug Library

I recently had some issues with debugs as I would have to CONSTANTLY create different debug messages. I got tired of that so I made a simple library to ease up my pain. It has a couple of functions in it so Ill list them

getcLine()
local test = Debug:getcLine() --Gets the line calling the function
getsName()
local test = Debug:getsName() --Gets the script calling the function
getfName()
local test = Debug:getfName() --Gets the function calling the function

Also, if you call the module as a function, it prints this
Debug called on line X in script: <name>

Here is an example of the module in use:

local Debug = require(game.ReplicatedStorage:WaitForChild("Debug"))

function test()
	Debug()--prints Debug called on line 4 in script: <name>
	print(Debug:getcLine()) --prints 5
	Debug()--prints Debug called on line 6 in script: <name>
	print(Debug:getsName()) --prints script name
	Debug()--prints Debug called on line 7 in script: <name>
	print(Debug:getfName()) --prints test
end

test()

I am sorry if this script/service is too simple. This is my first release of anything on the forum :smile:

Module link:

–edit, thanks for telling me about the spelling errors

5 Likes

It seems that you mispelled this part. Cool module, though!

Yeah, I understand that, but this is more for people who dont really understand the debug class and dont really know how to do much of what your saying. As for the output and dev, I only really made the script for my own personal use, found it useful, and decided to give other people the chance to try it. Im not tryna release something revolutionary. Thanks for the feedback tho!

1 Like