Get file name of a LUA file inside of it

So, I’m modifying http.Post function because a guy that made an addon for the server where I’m a developer on (no, I couldn’t have made), it used this function to get the rcon_password and send it to a database.

But one of the modifications I’m trying to do is to record each file that requests a http function, and to that I want to record the directory, name and line of the function request, just like the LUA Errors report, like this:

I have no idea on how to do it, could someone help me, please?

This, perhaps?

[editline]11th March 2014[/editline]


Thx, I’ll test it :smiley:

[editline]11th March 2014[/editline]

But now how am I going to call that if I’m editing the http module, not the files where it is located on?

the argument actually takes more than just a function as an argument - you can put a thread number (0 - 12) where 1 is the thread that called the function and 2 is the thread that called the calling function, etc.

Could you be more specific, please, i dont know if you’re talking about debug.sethook or debug.getinfo


Oh, thx, this solved all of my problems! :smiley: