IslandMedic Member Licensed User Longtime User Dec 22, 2019 #1 I am creating a logging app on steroids. Is there a way to pass to my logging sub the name of the subroutine that is issuing the logging call. sub logger(routinename as string, data as string) do stuff end sub Sub Jump logger(???,"we are doing stuff"") end sub in place of the ??? i would like to auto pass the name of the calling routine in this case "Jump" thanks Brad
I am creating a logging app on steroids. Is there a way to pass to my logging sub the name of the subroutine that is issuing the logging call. sub logger(routinename as string, data as string) do stuff end sub Sub Jump logger(???,"we are doing stuff"") end sub in place of the ??? i would like to auto pass the name of the calling routine in this case "Jump" thanks Brad
Cableguy Expert Licensed User Longtime User Dec 22, 2019 #2 You can use a global variable in order to store the class name as string, or use the Me keyword, but it's content is not what you expect... Upvote 0
You can use a global variable in order to store the class name as string, or use the Me keyword, but it's content is not what you expect...
R Roycefer Well-Known Member Licensed User Longtime User Dec 22, 2019 #3 Use the jAWTRobot library and call the method robot.B4JCallingThreadStackTraceGet(). If you call this inside your logger sub, the calling sub should be the 2nd or 3rd element in the stack trace array. Upvote 0
Use the jAWTRobot library and call the method robot.B4JCallingThreadStackTraceGet(). If you call this inside your logger sub, the calling sub should be the 2nd or 3rd element in the stack trace array.