hwstow
13th January 2014, 18:39
hi!
anybody tried to read out the function stack at runtime, for example to do error logging? any thoughts about that, do you think it's possible?
greets
hwstow
bhushanchanda
13th January 2014, 19:11
Hi,
Can you elaborate?
hwstow
13th January 2014, 19:40
What i want to do is adding a logging function to a DLL/ueDLL, that is capable to log what process called it and which functions (and parameters) were called to reach this point. The same information, that is logged when a fatal error appears or if you click "stack" in debugger. The object/prcoess itself should have this data, and maybe there is a way to retrieve it. I searched the tt libraries for useful functions but could not find anything. Just thought i can't be the only one that want's to do this.
bhushanchanda
13th January 2014, 19:58
Hi,
You can trace your bshell to get all this information. You have a lot of options like getting object information, getting program flow, getting database actions etc. You can just set a trace to your session, go through the processes and take the trace file which will cover a lot of things.
NPRao
13th January 2014, 23:05
Please use the search option to refer to the already discussed topics.
Refer to - How Do I know what dll gets the program flow (http://www.baanboard.com/baanboard/showthread.php?t=52702&highlight=program+flow)
hwstow
14th January 2014, 11:47
Hi! Thanks for your replies, but the point is i don't want to do a trace. I wan't to log the stack independent to the environment settings because i don't know when which bshell process will produce an error. Therefore i am trying to fetch this information at runtime.
bhushanchanda
14th January 2014, 11:59
Exactly!
You don't know which processes are executed at the run-time and hence comes the logger into picture. As mentioned, if you want the logs/traces, setting the Debugging BW Commands which Prashant has mentioned in the thread or taking a trace using BW logger (ttstpbshdebug) is the only way to identify the things you are looking for.
Not sure what exactly are you trying to ask, you should check the link Prashant has mentioned in his signature.
May be you want to produce your own log files like what the system does using some inbuilt tools functions/dll's in your Program Script. But I am afraid, they might not be compatible to your 4GL scripts or may be out of its scope. Again, not sure what you are looking for.
Also, for other system based logs you can use:- ttstperrlog