Hey - I am looking for a code snippet to dynamical...
# cfml-beginners
a
Hey - I am looking for a code snippet to dynamically return the current class and function that I am in. Say for use in tracing or logging where you don't have a stack trace. I swear I saw a video (I think on refactoring and modernizing code) and there was a part where the presenter showed a snippet of code to do this. I guess that included getFunctionCalledName(), alongside something else. Anyone have something like this they use? -- ideally that works in Lucee. tnx!!
Ok I guess something like this works in a component's method
getMetaData(this).fullName & '.' & getFunctionCalledName()
not sure how expensive a call to getMetaData is, but seems to get it done.
👍 1