An event logger is a logger which can log various events or error happening in an application run. Usually it would be a simple text file or csv file with info about the run details of the application. An event logger can help in various ways.
- It can help in identifying the error happened after an operator simply tells you that “Hey you developer! Something went wrong in your application, debug it quickly, production is paused cuz of this issue!!”. In such case, if you have an event logger, you wouldn’t need to rerun the app to identify error again. Just simply looking at the error log can give a hindsight.
- It can help if the LabVIEW application is completely parallel, then identifying the root-error becomes difficult with lots of error popping from various loops due some root-error. If you have event logged, then you can find the root-error easily which triggered all other error.
- During the integration testing, if you have various event messages, it can help you to check if the sequence of operation is going proper. This also applies in production time.
- It can simply help to find the time gap between different steps in your sequence of operations.
There are countless uses cases like this for an event logger…
For a LabVIEW application, this event logger often needs to be developed while we develop our core application. Often due to project deadlines, such features are ignored at development time and struggled at the deployment/production time. Nevertheless a good architect never ignores such feature to be part of the application. Though it takes time for adding various event messages at various points of the project, it all worth at the integration testing and deployment time. It can helping finding root causes of various issues arising in the deployment time. Since there is NO application which is can just be developed and deployed without any issues, such feature is necessary for any application.
Due to the extra effort required for such a feature, often it’s neglected by early stage developers. Even the experienced developers, looks at the deadlines and use it only when it’s high time. To help myself and help others in such cases, here is an open source of my own favourite event logger in GitHub. I also hereby invite you all to contribute to the source by forking.
Features of this Event-Logger
- Runs as a separate actor. So, this event logger can run in parallel loop and it doesn’t affect the main loop’s determinism.
- All logs are messages to that separate actor.
- Logs the events in the same order of sequence how the messages are sent.
- Logs the timestamp at the time of messaging. i.e., the closest time to log is captured.
- Logs errors with more easily readable call chain.
- Boolean error indicator references can be attached to indicate the error status. Boolean error indicator turns true when error occurs.
- Error file opens in notepad on clicking the error boolean indicator.
- String event indicator references can be attached to indicate various messages being logged. This displays the recently logged events in given string reference. Auto scrolls the indicator to latest message.
- Any number of such log-string and boolean indicator can be used in various parts of the application.
Links
LabVIEW Event Logger Releases
Ajay is a professional developer and architect of NI-LabVIEW applications with extreme interest in getting the hardware connected to LabVIEW and automating the stuff. Recently he is also putting his hands in NI-TestStand to get very dirty on it. He is also a good mentor for the various interns in his career. He is ready to help the people in techie roles.