Is there a way to get caller function name?
Hey everyone,
i'm looking for a simple way to get the caller name of function for a log trace method for debugging my addons. I tried many ways and it should not possible to get the information via "debug.getinfo". The function seems to disabled in LUA/ESO context. So is there another way to get the caller informations or 'im doing something wrong? |
trigger an error and the backtrace will be shown ?
d(I'm a stupid dev who forget quotes) |
Or err() if you don't want to halt.it. ( I think that is the right function name)
|
I will try both, but @Ayantir your solution looks very dirty. :)
BTW you have a PM Ayantir |
My method is basically the same as Ayantir's. Also, I checked and it's actually error()
|
All solutions does not help. I only want a debug message to chat with caller function, without anoying type the function name as string into the message. The error() function throws an assertion, wich ends into an UI error.
For example Lua Code:
|
It's Lua embedded into a sandbox of a MMORPG, not Java or C#, you won't have all the fancy things.
|
Well, I suppose if you want to be really fancy, you can do local _, errorMessage = pcall(function()error()end) and then make a function to parse errorMessage but the simplest way is just read the error message, and if you do, you'll see 'hey this thing does give me a trace!'
|
Lua Code:
Lua Code:
|
http://www.esoui.com/downloads/info1210-sidTools.html
Quote:
|
All times are GMT -6. The time now is 06:09 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI