10-28-2017 09:34 PM
I'm starting work on a new project and the customer would like to use the DQMH. The examples are good, but I'm having a little trouble conceptualizing where I should put my error logging at. Should I create a new singleton module that wraps my error logger and give it a Request that allows every other modules to register their error events with it? That seems the most DQMH-ish way of doing things.
Any other suggestions?
10-29-2017 04:34 AM
You could also do it the other way around and register the Status and Error Broadcast Events of your DQMH modules with your error logger. We make heavy use of the broadcast events and register for them in different places: List of events displayed in GUI, logging to disk, centralized error handling...
On our real-time applications, we register for them directly in our main.vi to update the Linux Embedded UI. On Windows, it would rather be our UserInterface DQMH module that displays them.
I'm also interested in hearing others' opinions.
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )
10-30-2017 08:52 PM
Hi Ian,
I agree with Joerg's approach.
You can make your top level Module or VI that launches all your DQMH modules register for the Status Updated and the Error Reported broadcast events of all your modules. From there, you can decide if you log to file directly there or If you create a separate Error Logger DQMH module that would itself register for all of the Error Reported Broadcast events.
One of the beauties of custom Events is that if you decide you don't want to log errors, you just don't start that error logger and that is it no problem.
Your idea of creating a specific DQMH module that has a request to log errors is not bad either. You could then have different requests for different types of logging (high priority errors, show stoppers, etc). However I prefer to take advantage of the Error Reported broadcast.
I am also curious to see what others have done.
Keep us posted on your progress on this project and please thank your customer for trusting DQMH and wanting to use it 🙂
Regards,
Fab