11-29-2018 09:44 AM
I’m currently struggling with some serious error handling/logging issues. The scenario is: I’m building a server / client framework with different packages for the clients. At the server side, there are all packages located which are dynamically loaded when the client asks for it (for grabbing some data/ central data processing / etc.).
Everything is fine so far. The packages are organized as LVLIBPS with a defined Interface LVLIBP which all have in common. Let’s call the shared LVLIBP the Interface.lvlibp. The Interface includes e.g. the error management, some common shared things, like some parts of the framework I’m using, some data management, etc.
At the server side the libraries are called with the help of the Delacor Queued Message Handler. Later on a few 10s of these shared libraries are running in parallel with the shared Interface.lvlibp. If one VI causes an error it is calling LogError.vi inside the Interface.lvlibp. To obtain some additional information about the error (logged in user / clientID which requested function / calling LVLIBP) I have to call a VI of the corresponding class which is dynamically dispatched from the Interface.lvlibp.
Does anybody has any idea how to realize such a scenario without distributing the class wires inside each location where the LogError.vi is called?
Thanks in advance
Solved! Go to Solution.
11-29-2018 10:46 AM
Use an abstract message class that would contain the error and related data. Send that to your error logger. Another method would be to create helper classes which could be used to get that information.
11-30-2018 01:09 AM
Do you have any recommendations for a good example?
11-30-2018 09:32 AM
The actor framework is a good example of a generic definition of a message class that is used in the framework and then given concrete definitions for the actors as they are created. You do not have to use the actor framework for your application but it does provide an example of how this can be done.
12-10-2018 12:43 AM
Thanks for the answer.
I already thought about the actor framework inside my application. I’ve used a similar solution via queues. Each plugin has its own queue which sends the errors to a main queue which is sending the data to the log client. So therefore I can distinguish between the plugins which are causing the errors.